Computer Science, asked by Unknown1000, 10 months ago

WAP to check whether a number is even or odd using *While loop* in 'java'.

Answers

Answered by varadhabala29
2

Answer:

import java.util.Scanner;

class Check

{

public static void main(String args[])

{

Scanner s=new Scanner(System.in);

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

int n=s.nextInt();

if(n%2==0)

System.out.println("Even");

else

System.out.println("Odd");

}

}

Similar questions