Even & Odd Number Using if else Statement Program in Java

public class Even
{
public static void main(String args[])
{
int n=5;
    if(n%2==0)
    {
        System.out.println("This is Even number="+n);
    }
else
{
System.out.println("This is Odd number="+n);
}
}
}
Output:-
This is Odd number=5




Previous                                   Next

No comments:

Post a Comment