write a c program that accepts a numbers from the user and display whether the number inputted is an even or odd number?
#include <stdio.h>
#include <stdlib.h>
//main function
int main(){
int number;
//prompt user to enter number
printf("Enter number: ");
//read number
scanf("%d",&number);
//display whether the number inputted is an even or odd number
if((number%2)==0){
printf("The number inputted is an even number\n");
}else{
printf("The number inputted is an odd number\n");
}
system("PAUSE");//delay
return 0;
}
Need a fast expert's response?
Submit order
and get a quick answer at the best price
for any assignment or question with DETAILED EXPLANATIONS!
Learn more about our help with Assignments:
C