1System.out.println("How many sattelites does JUPITER have ??");
2 C = scan.nextInt();
3
4 if (C == 79)
5 {
6 System.out.println("Congrats ! You got the Third Question Right :)");
7 points = points + 1;
8 }
9
10 else if (C != 79)
11 {
12 System.out.println("Sorry but your answer is wrong :(");
13 }
1
2import java.io.*;
3
4class GFG {
5 public static void main(String[] args)
6 {
7 // initializing expression
8 int i = 20;
9
10 // condition 1
11 if (i == 10)
12 System.out.println("i is 10\n");
13
14 // condition 2
15 else if (i == 15)
16 System.out.println("i is 15\n");
17
18 // condition 3
19 else if (i == 20)
20 System.out.println("i is 20\n");
21
22 else
23 System.out.println("i is not present\n");
24
25 System.out.println("Outside if-else-if");
26 }
27}