write a program to check if the no. is even or odd
Answers
Answered by
1
import java.util.Scanner;
public class Num4
{
void main()
{
Scanner sc=new Scanner(System.in);
System.out.println("enter a no.");
int a =sc.nextInt();
if (a%2==0)
System.out.println("even");
else
System.out.println("odd");
}
}
Answered by
0
hey mate
ur ianswer is in that attachment
HOPE that helps u
ur ianswer is in that attachment
HOPE that helps u
Attachments:
Similar questions