# 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

#include <stdio.h>
int main()
{
int n;
/* Enter value of n */
printf("Enter value of n : ");
scanf("%d",&n);

/* To check wheater n is odd or even */

if(n%2==0)
printf("%d is Even number",n);

else
printf("%d is Odd number",n);

}
answered Feb 26 by (140 points)
[#include<iostream.h>

int main()

{

int n;

if{ n%2==0;

cout<<"number is even";

}

else{cout<<"number is odd";

}

return 0;

}
answered Feb 29 by (150 points)
#include<stdio.h>

int main()

{

int n;

printf("Enter n value"):

scanf("%d",&n);

if(n%2==0){

printf("Even");

}

else{

printf("Odd");

}

}
answered Mar 1 by (150 points)
import java.util.Scanner;
class Main
{
public static void main(String[] args)
{
Scanner input =new Scanner(System.in);
System.out.print("enter the number = ");
int n = input.nextInt();
if(n%2==0)
{
System.out.println("N is even no.");
}
else
{
System.out.println("N is odd no.");
}
}
}
a=int(input("ENTER A NUMBER: "))

if(num%2)==0:

print("even number")

else:

print("odd number")
answered Jun 10 by (470 points)
#include<stdio.h>
main()
{
int a;
printf("enter a number\n");
scanf("%d",&a);
if(a%2==0)
{
printf("number is even");

}
else
{
printf("number is odd");
}
}