odd or even. As we have taken 4 to check whether it is even or not. It is even because when we divide it by 2 then the reminder will be 0.
class Evenodd
{
public static void main(String args[])
{
int a = 4;
if((a % 2) == 0)
System.out.print("Number is even");
else
System.out.println("Number is odd");
}
}
A very simple program to find whether a number is Thursday, February 7, 2008
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment