Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 2

PROGRAM NO:11

file name:11.c

//*write a program to accept a number and check whether the number is odd or even*//
#include<stdio.h> //header file
main() //program execution begins
{
int no; //variables
printf("enter the no:");
scanf("%d",&no);
if(no%2==0) //if condition begins
{
printf("no.%d is even ",no);
}
else
{
printf("no.%d is odd ",no);
} //if condition ends
} //program ends
OUTPUT:

[it10530@sbitserver it10530]$ gcc -o 11 11.c


[it10530@sbitserver it10530]$ ./11
enter the no:56
no.56 is even

You might also like