Write a C program to check whether a number is even or odd.

 code:-

#include<stdio.h>
int main()
{
int n;
printf(“Enter a number “);
scanf(“%d”,&n);
if(n%2==0)
{
printf(“Number is even”);
}
else
printf(“Number is odd”);
return 0;
}

Output:-

Enter a number
25
Number is odd

Video solution:-



Recommended Post:

Hackerearth Problems:-

Hackerrank Problems:-

Data structure:-

Key points:-

 MCQs:-

Leave a Reply

Your email address will not be published.