Write a C program to check whether the given number is odd or even.
Here's a C program to check whether a given number is odd or even:
#include <stdio.h> int main()
{
int n; printf("Enter a number: "); scanf("%d", &n); if (n % 2 == 0) printf("%d is an even number.\n", n); else printf("%d is an odd number.\n", n); return 0; }
Comments
Post a Comment