-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbasicsofjavaapnacollege.java
More file actions
120 lines (96 loc) · 2.67 KB
/
basicsofjavaapnacollege.java
File metadata and controls
120 lines (96 loc) · 2.67 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
// pritn the pattern
// System.out.println("*");
// System.out.println("**");
// System.out.println("***");
// System.out.println("****");
// pritn two line star
// System.out.println("*");
// System.out.println("**");
// // variable
// int a = 89;
// int b= 78;
// int sum = a+b;
// System.out.println(sum);
// // subtract
// int sub = a-b;
// System.out.println(sub);
// // multiply
// int mul = a*b;
// System.out.println(mul);
// // divide
// int div = a/b;
// System.out.println(div);
// // module
// int mod = a%b;
// System.out.println(mod);
// // quiz ouetion (a*b)/(a-b)
// int x = 10;
// int y = 15;
// int c = x*y;
// int d = x-y;
// System.out.println(c/d);
// //System.out.println((x*y)/(x-y));
// scanner class
// Scanner sc = new Scanner(System.in);
// String name = sc.next();// for input the single line
// String name2 = sc.nextLine();// used to take an complete line as an input
// System.out.println(name);
// System.out.println(name2);
// take an two varialbe from user input
// Scanner sc = new Scanner(System.in);
// int a = sc.nextInt();
// int b = sc.nextInt();
// int sum = a+ b;
// System.out.println("the sum of a and b is " + sum);
// }
// }
// comditional statement
import java.util.Scanner;
public class basicsofjavaapnacollege {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
// vote adult prograam
// int age = sc.nextInt();
// if(age>18) {
// System.out.println("eligible foe the vote");
// }
// else {
// System.out.println("not eligible for the vote");
// }
// odd even program
// int x = sc.nextInt();
// if(x%2==0) {
// System.out.println("even");
// }
// else {
// System.out.println("odd");
// }
//int a = sc.nextInt();
//int b = sc.nextInt();
// if(a==b) {
// System.out.println("equal");
// } else if(a>b) {
// System.out.println("a is a greater");
// } else {
// System.out.println("a is a leasser");
// }
// if 3 is a even no print bazinga
// if(3%2==0) {
// System.out.println("bazinga");
// } else {
// System.out.println("not bazinga");
// }
// butoon program
int button = sc.nextInt();
if(button == 1) {
System.out.println("namaste");
} else if(button == 2) {
System.out.println("hello");
} else if(button == 3) {
System.out.println("creative");
}
else {
System.out.println("not matched");
}
}
}