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
6#666#665533999 where # is used as space.output is monkey

Ravi is a newbie to the programming and while learning the programming language he came to know the following rules: · Each program must start with ''''''''{'''''''' and end wi

write the program to accept date and to say valid or invalid

I want MODI method''s coding in c++ using all concepts of c++..please help me its my project work...


Define register with bit fields? We could define register simply with bit fields: struct DISK_REGISTER { unsigned ready:1; unsigned error_occured:1; unsigned disk_spinni

Question : (a) How does a structure differ from an array? (b) Describe how a structure differs from a union? (c) Declare a union called ‘clothes' which consists of the

I need a project on car rental system using c programming only of college level

Define the Relational Operator in c language? The Relational operators refer to the relationships that values can have with one another and they are used to compare two operand

getting a palindrome using minimum replacement