HOW TO CHEEK WHEATHER A NUMBER IS ODD OR EVEN USING C PROGRAMMING
Can you lean coding to easy way? so please follow our site .if you have any problem about coding then you can inform us by comment .we will solve your problem .
so let's start
c language is a one of the oldest and finest language which is developed by Dennis ritchie in 1972 .
To cheek wheather a number is odd or even
some step given bellow:
1st step: Add header file same as #include<stdio.h>
2nd step: take integer value from user
3rd step: if taken integer value is divisible by 2 then display 'number is even'
if taken integer value is not divisible by 2 then display 'number is odd'
and at last add return0;
4th step : stop
If you have any queries about this post ,you can comment me or send message via email.
#include<stdio.h>
int main(){int num;
printf("enter your number");
scanf("%d",&num);
if(num%2==0){
printf("%d is even",num);
}
else{
printf("%d is odd",num);
}
return 0;
}
0 Comments
HAVE YOU ANY QUEERY,LET ME KNOW !