Completely Solved C, C++ Programs Assignment.




C Program To Read A Number And Find Whether The Given Number Is Even Or Odd.

Filed Under:

Problem 5: C Program To Read A Number And Find Whether The Given Number Is Even Or Odd.
#include<stdio.h>
#include<conio.h>
main()
{
int n,r;
clrscr();
printf(“ENTER A NUMBER ;”);
scanf(“%d”, &n);
r=n%2;
if(r= = 0)
printf(“the above given number is even number”);
else
printf(“the above given number is odd number”);
getch();
}
C compiler: gcc 4.1.2

Back to main directory: Sample C Program | Software Practical | Solved C Assignment


Get Free Programming Tutorials and Solved assignments