15) Write a program to accept a number and check if it
is even or odd.
Answers
Answered by
1
Answer:
In java
Step-by-step explanation:
import java.util.*;
public class Program
{
public static void main(String args[])
{
Scanner in =new Scanner(System.in);
int a;
a=in.nextInt();
if (a%2==0)
{
System.out.println(a+" is an even number");
}
else
{
System.out.println(a+" is an odd number");
}
}
}
Similar questions
Math,
2 months ago
Math,
2 months ago
India Languages,
2 months ago
Accountancy,
5 months ago
Social Sciences,
5 months ago
Science,
11 months ago
English,
11 months ago