76 836
Assignments Done
Successfully Done
In June 2019

Answer to Question #3532 in Java | JSP | JSF for Y mukundareddy

Question #3532
Write a program to find the given number is an even or odd number using if else statements?
Expert's answer
import java.util.Scanner;

public class Main {

public static void main(String[] args) {

int n;

Scanner in = new Scanner(System.in);

System.out.print("Enter a number: ");

n = in.nextInt();

if(n % 2 == 0)

System.out.println(n + " is even");


System.out.println(n + " is odd");



Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!


No comments. Be first!

Leave a comment

Ask Your question

Privacy policy Terms and Conditions