Answer to Question #278763 in C for Venkatesh

Question #278763

Write a C program to check whether the given number is odd or even using if,if else

1
Expert's answer
2021-12-12T12:19:37-0500
#include <stdio.h>




int main()
{
    int number;
    
    /* Input number from user */
    printf("Enter any number: ");
    scanf("%d", &number);
    
   
    if(number%2==0)
    {
        printf("The number is even.");
    }
    else
    {
        printf("The number is odd.");
    }


	getchar();
    getchar();
    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 the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS