We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents ff5599e + 5224b8f commit 51822c1Copy full SHA for 51822c1
1 file changed
Basic Codes/greaterOrLesserThan10.java
@@ -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