Example for if statement,
Wap to check whether the given number is even or odd.
#include
main()
{
int number;
printf("\nEnter any number ");
scanf("%d",&number);
if(number%2==0)
printf("\nGiven number is even");
else
printf("\nGiven number is odd");
}
Wap to check whether the given number is even or odd.
#include
main()
{
int number;
printf("\nEnter any number ");
scanf("%d",&number);
if(number%2==0)
printf("\nGiven number is even");
else
printf("\nGiven number is odd");
}
Comments
Post a Comment