πc program for check given number is even or odd.
if number is divisible by 2 and reminder is zero then given number is even
otherwise given number is odd
eg.i am enter number 12 the it print the given number is even
//first include header files
#include<stdio.h>
#include<conio.h>
void main()
{
int no;
printf("enter number\n");
scanf("%d",&no);//here we can take number form user
if(no%2==0)
{
printf("the given number is even\n")l
}
else
{
printf("given number is odd\n");
}
getch();
}
output → enter number
12
the given number is even
THANKS ...π
if number is divisible by 2 and reminder is zero then given number is even
otherwise given number is odd
eg.i am enter number 12 the it print the given number is even
//first include header files
#include<stdio.h>
#include<conio.h>
void main()
{
int no;
printf("enter number\n");
scanf("%d",&no);//here we can take number form user
if(no%2==0)
{
printf("the given number is even\n")l
}
else
{
printf("given number is odd\n");
}
getch();
}
output → enter number
12
the given number is even
THANKS ...π
No comments:
Post a Comment