Math, asked by xxsiddharthraoxx, 5 months ago

15) Write a program to accept a number and check if it
is even or odd.​

Answers

Answered by ayushmaurya2612
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