Search C Program

Even Odd Number

/* Check a number is even or odd */

#include<stdio.h>
int main()
{
    int a;
    printf("Enter a number: ");
    scanf("%d",&a);
    if(a%2==0)
        printf("Even Number");
    else
        printf("Odd Number");
   return 0;
}

2 comments:

  1. Input a number until the user presses 0, and check whether the entered number is divisible by 3 or 5. Also count the total numbers divisible by 3 0r 5 and then separately display each calculated information

    ReplyDelete