60 429
Assignments Done
98,1%
Successfully Done
In April 2018

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

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!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions