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

+4 votes
asked Jun 19, 2018 by Ashraful Islam Tanzil 2 flags
closed Jun 11 by Admin
Please give me a easy learning script as a example.
closed with the note: Closing question, since it has been answered

36 Answers

0 votes
answered Jul 4, 2018 by Manasa Manasa (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");

}

}
0 votes
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");
 
}
}
0 votes
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);
}
0 votes
answered Jul 12, 2018 by Saba Tehrani (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;

}
0 votes
answered Jul 12, 2018 by vesper Niet (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") ;
}
0 votes
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;
}
0 votes
answered Jul 14, 2018 by yashodha kodag (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);

}

}
0 votes
answered Jul 14, 2018 by yashodha kodag (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);

}

}
0 votes
answered Jul 14, 2018 by yashodha kodag (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);

}

}

Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...