To check whether number is even or not

CODE :

public class P_03_even_odd_part1 {
public static void main(String[] args) {
int a=5;
if (a%2==0) {
System.out.println("No. is Even");
}
else {
System.out.println("No. is Odd");
}
}

}

Output :


Comments

Popular posts from this blog

To create an html page with frames and frameset

1. Write a program to insert a new element at end as well as at a given position in an array in Java

1. To familiarize with network devices like switch, hub, routers and bridges in LaTex