C program to check even & odd no, C/C++ Programming

C Program to Check  EVEN & ODD NO

 

main()

{

          int n, a;

          clrscr();

          printf("ENTER ANY NUMBER: ");

          scanf("%d", &n);

          a=n%2;

          if(a==0)

          {

                    printf("THE NUMBER IS EVEN...\n");                   

          }

          else

          {

                    printf("THE NUMBER IS ODD...\n");

          }

          getch();

}

 

OUTPUT :

Enter Any No: 5

The number is odd

Posted Date: 9/10/2012 2:02:52 AM | Location : United States







Related Discussions:- C program to check even & odd no, Assignment Help, Ask Question on C program to check even & odd no, Get Answer, Expert's Help, C program to check even & odd no Discussions

Write discussion on C program to check even & odd no
Your posts are moderated
Related Questions
Simple program of c++: int main() {    int   bushels;    float dollars, rate;                 cout                 cin >> dollars;                 cout

6#666#665533999 where # is used as space.output is monkey

programme for time table in c++

I have a program for school and I am not understanding why one of the variables gets skipped or the arithmetic operators aren''t having any effect as I have tryed defining it sever


program of area under integration

Define a procedure that takes three numbers as arguments and returns the sum of the squares of the two larger numbers.


A Padovan string P(n) for a natural number n is defined as: P(0) = ‘X’ P(1) = ‘Y’ P(2) = ‘Z’ P(n) = P(n-2) + P(n-3), n>2 where + denotes string concatenation. For a string of the c