C program to check whether the given number is odd or even

 Program code

#include <stdio.h>

#include <conio.h>

void main()

{

int a;

clrscr();

printf("Please input a number to find whether it is odd or even.\n");

scanf("%d",&a);

if ((a%2)==0)

printf("%d is even.\n",a);

else

printf("%d is odd.\n",a);

getch();

}


Example of output

Please input a number to find whether it is odd or even.

700

700 is even.

Share:

No comments:

Post a Comment

Popular Posts

Contact Form

Name

Email *

Message *

Recent Posts

Copyright Matlab Project Codes All rights Reserved. Powered by Blogger.

Blog Archive