Write a program in c to find even or odd numbers
Flowchart:
Algorithm:-
· start
· input number
· if(number%2==0) then it is even number
· else odd number
· end
Program:
#include<stdio.h> #include<conio.h> void main() { int n,r; clrscr(); printf(“Enter a number:”); scanf(“%d”,&n); r=n%2; if(r==0) { printf(“Even number”); } else { printf(“odd number”); } getch(); }
Output:
Enter a number :4 Even number
Enter a number :5 odd number
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.
Flowchart:
Algorithm:-
· start
· input number
· if(number%2==0) then it is even number
· else odd number
· end
Program:
Output:
need an explanation for this answer? contact us directly to get an explanation for this answer