Wednesday, May 20, 2020

Find even or odd number in C

  • Program :
#include <stdio.h>
int main()
{
 
    int num;
    printf("\n----------------EVEN NO OR NOT----------------"); 
    printf("\nEnter an integer number: ");
    scanf("%d",&num);
    if(num%2==0)
        printf("\n%d is an EVEN number.",num);
    else
        printf("\n%d is an ODD number.",num);

    return 0;
}




  • Output :


No comments:

Post a Comment

Function Overloading in C++

https://monitechvenkat1620.blogspot.com Program : #include <iostream> using namespace std; int c(int x, int y) {   return...