Write a program to check whether a short type number taken as input is an
even number or an odd number.
Answers
Answered by
1
//program to check whether the number is even or odd
public class EvenOdd
{
public static void main(int num)
{
System.out.println("The number is"+num);
if(num %2==0)
{
System.out.println("The number is even");
}
else
{
System.our.println("The number is odd");
}
}
}
Here, num is the parameter.
Mark me as Brainliest
Similar questions