package Example1;
public class RelationalOperator {
public static void main(String[] args) {
// TODO Auto-generated method stub
int randomnumber=(int)(Math.random()*49);
if(randomnumber<25){
System.out.println("The number is less than 25");
}else if(randomnumber > 40){
System.out.println("The number is greater than 40");
}else if(randomnumber == 30){
System.out.println("The number is equal to 30");
}else if(randomnumber != 10){
System.out.println("The number is not equal to 10");
}else if(randomnumber <= 14){
System.out.println("The number is less than equal to 14");
}else if(randomnumber >= 14){
System.out.println("The number is greater than equal to 14");
}else{
System.out.println("nothing matched");
}
System.out.println("The random number is "+randomnumber);
}
}
output:
Is not predictable since it uses random value >>>Logical Operator
------------------------------------------------------------------------------------------------------------
No comments:
Post a Comment