-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
44 lines (36 loc) · 1.26 KB
/
Copy pathMain.java
File metadata and controls
44 lines (36 loc) · 1.26 KB
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
Basic obj = new Basic();
int a=0;
do {
System.out.println("Enter your choice.");
System.out.println("1.Odd even number check from array");
System.out.println("2.Check if string is palindrom or not.");
System.out.println("3.Check if number is prime or not.");
System.out.println("4.Exit");
a = sc.nextInt();
switch (a) {
case 1:
obj.even_odd_check();
break;
case 2:
String str;
System.out.println("Enter string.");
str=sc.next();
obj.Palindrom_Check(str);
break;
case 3:
System.out.println("Enter number.");
int n=sc.nextInt();
obj.isPrime(n);
break;
case 4:
break;
default:
System.out.println("Invalid input...");
}
}while (a!=4);
}
}