-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCapital.java
More file actions
29 lines (23 loc) · 773 Bytes
/
Copy pathCapital.java
File metadata and controls
29 lines (23 loc) · 773 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package Mypack;
import java.util.Scanner;
public class Capital {
public static void main(String[] args) {
// TODO Auto-generated method stub
System.out.println(" 1.India\n2.Srilanka\n3.australia\n4.nepal");
Scanner sc = new Scanner(System.in);
System.out.println("enter a choice: ");
int num = sc.nextInt();
switch(num) {
case 1: System.out.println("capital of india is : Delhi");
break;
case 2: System.out.println("capital of srilanka is : colambo");
break;
case 3: System.out.println("capital of australia : cenbera");
break;
case 4: System.out.println("captal of nepal: kathmandu");
break;
default:
System.out.println("please enter a valid a input");
}
}
}