belongs to collection: If/Else C Programs to Practice
Write A C Program For Check Number Is Even Or Odd
Logic :
Logic is very very simple as we know that if number is divisible by 2 then number is Even else Number is Odd
#include<stdio.h> int main() { int num; printf("\nEnter Any Number To Check Even Or Odd :\n"); scanf("%d", &num); if (num%2 == 0) { printf("%d is EVEN\n", num); } else { printf("%d is ODD\n", num); } return 0; }
Output:
Enter Any Number To Check Even Or Odd:
111
111 is ODD
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
Output:
Enter Any Number To Check Even Or Odd:
111
111 is ODD
need an explanation for this answer? contact us directly to get an explanation for this answer