Develop a C program to check whether given integer number is ODD or EVEN using using if...esle statement.
Code
#include <stdio.h>int main() {int num;printf("Enter an integer: ");scanf("%d", &num);// true if num is perfectly divisible by 2if(num % 2 == 0)printf("%d is even.\n", num);elseprintf("%d is odd.\n", num);return 0;}
Output
Try -56 and comment your answer
0 Comments
Post a Comment