Write a program to input an integer and check whether it is greater than 100, or less than 100 or equal to 100.
Answers
Answered by
45
Hey there!
The program is as follows:
import java.util.*;
class Question
{
static void main()
{
Scanner sc=new Scanner(System.in);
int n;
System.out.println("Enter an integer:");
n=sc.nextInt();
if(n>100)
System.out.println("Greater than 100");
else if(n<100)
System.out.println("Less than 100");
else
System.out.println("Equal to 100");
}
}
Hope It Helps You!
Answered by
3
Answer:
Explanation
import java.util.*;
class Question
{
static void main()
{
Scanner sc=new Scanner(System.in);
int n;
System.out.println("Enter an integer:");
n=sc.nextInt();
if(n>100)
System.out.println("Greater than 100");
else if(n<100)
System.out.println("Less than 100");
else
System.out.println("Equal to 100");
}
}:
Similar questions