If Statement in java
Programme
import java.util.*;// we import java util package for input output//now we make our class
class Tree
{
public static void main(String args[]) //this is our main function
{
int a=30,b;
Scanner scn=new Scanner(System.in); //this is a class define in import java util
System.out.println("Enter any numb");
b=scn.nextInt(); //this is for input
if(b==a){
System.out.println("Wow you guess the numb");
}
else if(b<a)
System.out.println("Sorry your num is less then the original");
else
System.out.println("Sorry yor num is greater than original");
}
}
No comments:
Post a Comment