HTML Tutorial || Networking Assignment || Computer Full Forms || Ms-Office Shortcut Keys || Ms-Office Notes || Number System Notes || Internet Assignment
JavaScript Tutorial || CSS Tutorial || Operating System Notes || History of Computer Assignment || Netwoking Notes || Computer Fundamentals Notes

C Program to Check Whether a Number is Even or Odd Using If Else ?


Q:- Write a C Program to Check Whether a Number is Even or Odd Using If Else ?
  Input
       #include<stdio.h>
       #include<conio.h>
       int main()
   {
int num;
clrscr();
printf(“Enter a Number =”);
scanf(“%d”,&num);
if(num%2==0)
{
printf(“%d is Even Number.”,num);
}
else
{
printf(“%d is Odd Number.”,num);
}
getch();
   }


Output

Enter a Number = 2
2 is Even Number.

Comments