google407ec42f1ae5ff0e.html
top of page

Program to print whether a number is even or odd

Writer's picture: Yatendra AwanaYatendra Awana

P5.2 Program to print whether a number is even or odd

#include<stdio.h>

int main(void)

{

int num;

printf("Enter a number : ");

scanf("%d",&num);

if(num%2 == 0) /*test for even */

printf("Number is even\n");

else

{

printf("Number is odd\n");

num*=2;

printf("Now the number is %d\n",num);

}

return 0;

}

Recent Posts

See All

Comments


Facilities-:
One to one  online  / Offline Class
Individual training 
Corporate Training
E-Certificate for each course
Life time video accessible
E-Books

About us-:
Fin Computer Class
Sector 107, Noida  U.P.
M-: 9871715299
E: fincomputerclass@gmail.com
W-: www.computerclass.co.in
W-: www.it402.com
Y-:www.youtube.com/yka39

All Rights Reserved @ fin computer class     Design & Developed by Yatendra Kumar Awana

bottom of page