# Answer to Question #44891 in C for erico fire

Question #44891

write a c program that accepts a numbers from the user and display whether the number inputted is an even or odd number?

Expert's answer

#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;

}

#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 orderand get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

## Comments

## Leave a comment