Tuesday, 17 December 2019

To check whether a number is even or odd in C

#include<stdio.h>
#include<conio.h>
main()
{
int n;
printf("Enter a number ");
scanf("%d",&n);
if(n%2==0)
printf("The given number %d is even..",n);
else
printf("The given number %d is odd..",n);
}

No comments:

Post a Comment

Convey your thoughts to authors.