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
Explain what are Unions? The Unions like as structures, contain members whose individual data types may perhaps differ from one another. Though the members that create a union

Friend Functions One of the major features of OOP is information hiding. A class encapsulates data and methods to operate on that data in a single unit. The data from the class


C Program for REVERSE THE WORD IN STRING #include conio.h> #include stdio.h> #include string.h> void main() {           char a[50],b[25][25],temp;           i

#include stdio.h   struct  complex   {   float real;   float imag;   };   struct complex complexadd(struct complex,struct  complex);   void main()     {          Date: 26

Four cells, each with an internal resistance of 0.40 ? and an e.m.f. of 2.5 V are connected in series to a load of 38.40 ?. (a) Verify the current flowing in the circuit and t

Program is to define a class as student: Program is to define a class as student and display the records specific depending upon the number class student  {  private:

Default Arguments A default argument is a value that is automatically assigned to a formal variable, if the actual argument from the function call is omitted. e.g. void

Define Bitwise Left Shift and Right Shift Operators: >? The bitwise shift operators shift their first operand right (>>) or left ( // Illustration of the bitwise right shi

how to create a shopping cart and sibmit the code segment on screan