# How to make a program to find out odd or even numbers?

asked Jun 19, 2018 2 flags
closed Jun 11
Please give me a easy learning script as a example.
closed with the note: Closing question, since it has been answered

answered Jul 4, 2018 by (140 points)
#inckude<stdio.h>

void main()

{

int i;

printf("enter the i value");

scanf("%d",%i);

if(i%2==0)

{

printf("it is a even number");

}

else

{

printf("it is a odd number");

}

}
answered Jul 4, 2018 by jobu
#include <stdio.h>;
int main(){

if(x is divisible by two){
printf( "number is even");
}else {
printf("number is odd");

}
}
answered Jul 12, 2018 by anonymous
#include <stdio.h>
int main()
{
int a;
printf("enter any no:");
scanf("%d",&a);
if(a%2==0)
printf("\neven no");
else
printf("\nodd no");
return(0);
}
answered Jul 12, 2018 by (140 points)
#include <stdio.h>

int main()

{

int num;

printf("Enter number: ");

scanf("%d", &num);

if(num%2==0) {

printf("Number is even\n");

} else {

printf("Number is odd\n");

}

return 0;

}
answered Jul 12, 2018 by (180 points)
#include<stdio.h>

int checker(int);  // function declaration

int main(){

int num;

printf("Enter a number: ");

scanf("%d",&num);

checker(num);  // function call

return 0;

}

int checker(int x){

if (x%2==0){

printf("%d is even number",x);

}else{

printf("%d is odd number",x);

}

}
+1 vote
answered Jul 12, 2018 by Prakash
#include <stdio.h>

void  main()
{
int n;
printf("Enter a number : ");
scanf("%d",&n);
(n & 1) ? printf("number is odd"): printf("number is even") ;
}
answered Jul 12, 2018 by anonymous
#include<stdio.h>
int main()
{
int n;
printf("Enter the integer value:\n");
scanf("%d",&n);
if(n%2==0)
{
printf("This is the Even Number");
}
else
{
printf("This is the Odd Number");

}
return 0;
}
answered Jul 14, 2018 by (300 points)
#include<stdio.h>

main()

{

int i;

printf("\nEnter the number:");

scanf("%d",&i);

if(i%2==0)

{

printf("\nThe %d is even number",i);

}

else

{
printf("\nThe %d is odd number",i);

}

}
answered Jul 14, 2018 by (300 points)
#include<stdio.h>

main()

{

int n;

printf("\nEnter the number:");

scanf("%d",&n);

if(n%2==0)

{

printf("\nThe %d is even number",n);

}

else

{
printf("\nThe %d is odd number",n);

}

}
answered Jul 14, 2018 by (300 points)
edited Jul 14, 2018 by yashodha kodag

#include<stdio.h>

main()

{

int n;

printf("\nEnter the number:");

scanf("%d",&n);

if(n%2==0)

{

printf("\nEntered %d is even number",n);

}

}