Skip to content

Commit 51822c1

Browse files
Merge pull request #40 from Krush2311/master
Solution less or greater than 10
2 parents ff5599e + 5224b8f commit 51822c1

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
//write a program to check if number is greater than or less than 10
2+
import java.util.Scanner;
3+
public class greaterOrLesserThan10 {
4+
public static void main(String[] args) {
5+
Scanner reader = new Scanner(System.in);
6+
//Taking number from user
7+
System.out.println("Enter any number");
8+
int num = reader.nextInt();
9+
10+
//Checking whether num > 10
11+
if(num>10){
12+
System.out.println("Number is Greater than 10.");
13+
}
14+
//Checking whether num = 10
15+
if(num==10){
16+
System.out.println("Number is Equal to 10.");
17+
}
18+
//Checking whether num < 10
19+
else if (num<10){
20+
System.out.println("Number is Less than 10.");
21+
}
22+
}
23+
}

0 commit comments

Comments
 (0)