@@ -81,20 +81,20 @@ let's see an example:
81
81
// program to find whether a number is divible by both 3 and 5
82
82
// or divisible by only one of them
83
83
import java.util.Scanner ;
84
- public class Main
85
- {
86
- public static void main ( String [] args ) {
87
- Scanner sc= new Scanner (System . in);
88
- System . out. println(" Enter a number: " );
89
- int a= sc. nextInt();
90
-
91
- if (a % 3 == 0 && a% 5 == 0 )
92
- System . out. println(" The number is divisible by both 3 and 5" );
93
- else if (a % 3 == 0 || a% 5 == 0 )
94
- System . out. println(" The numbers is divisible by only one of them" );
95
- else
96
- System . out. println(" The numbers is not divisible by any of them" );
97
- }
84
+ public class Main {
85
+ public static void main ( String [] args )
86
+ {
87
+ Scanner sc = new Scanner (System . in);
88
+ System . out. println(" Enter a number: " );
89
+ int a = sc. nextInt();
90
+
91
+ if (a % 3 == 0 && a % 5 == 0 )
92
+ System . out. println(" The number is divisible by both 3 and 5" );
93
+ else if (a % 3 == 0 || a % 5 == 0 )
94
+ System . out. println(" The numbers is divisible by only one of them" );
95
+ else
96
+ System . out. println(" The numbers is not divisible by any of them" );
97
+ }
98
98
}
99
99
```
100
100
@@ -189,14 +189,11 @@ This category contains the following operators:
189
189
// syntax
190
190
// variable = Expression1 ? Expression2 : Expression3;
191
191
192
- public class Main
193
- {
194
- public static void main (String [] args ) {
195
- int num= 15 ;
196
- String msg = num > 10
197
- ? " Number is greater than 10"
198
- : " Number is less than or equal to 10" ;
199
- System .out .println (msg);
192
+ public class Main {
193
+ public static void main (String [] args ) {
194
+ int num = 15 ;
195
+ String msg = num > 10 ? " Number is greater than 10" : " Number is less than or equal to 10" ;
196
+ System .out .println (msg);
200
197
}
201
198
}
202
199
0 commit comments