c program
Examples :-
// even or odd program if else
//if else statement statement only allows
// program to execute one block of code if a check condition
// is true than execute the block or condition is false than exite the block
// of code.
#include<stdio.h>
int main()
{
int number= 0;
printf("enter a number");
scanf("%d",&number);
if(number %2 ==0 )
{
printf("%d is even");
}
else
{
printf("%d is odd");
}
return 0;
}
- ] c program to check number is even or odd
Output
enter a number
7 is Odd
- ] c program to check number is even or odd
Output
enter a number
2 is even
No comments:
Post a Comment