public class even_or_odd
{
public static void main(String[] args)
{
int num1=22;
mycode(num1);
}
public static void mycode(int num1)
{
if(num1%2==0)
{
System.out.println(num1+" is an even number");
}
else
{
System.out.println(num1+" is an odd number");
}
}
}
Output : 22 is an even number
Post a Comment