Computer Science, asked by aatmashrisanyal12, 1 year ago

write a program to check if the no. is even or odd

Answers

Answered by lyric
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 Aarchi111
0
hey mate

ur ianswer is in that attachment

HOPE that helps u
Attachments:
Similar questions