Friday, March 28, 2014

Get a number from user and check whether it is even or odd

#include<stdio.h>
#include<stdlib.h>
void line()
{
int i,j;
printf("\n");
for(i=1;i<=42;i++)
printf("=");
}
void header()
{
printf("\n");
printf("Built and Designed by Arslan Malik\n\n www.CworldbyAS.blogspot.com");
printf("\n");
}
int main()
{
line();
header();
line();

int a;
printf("Enter any Number to check whether it is even or odd = ");
scanf("%d",&a);
{
    if (a%2==0)
    printf("\nYou have entered an even number.\n \n \n \n",a);
    else
printf("\nYou have entered odd number.\n \n \n \n");
}
return 0;
}

No comments:

Post a Comment