-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconditional.java
168 lines (145 loc) · 4.3 KB
/
conditional.java
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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
public class conditional {
/**
* @param args
*/
public static void main(String args[]){
// Scanner sc=new Scanner(System.in);
// System.out.println("enter karo bhai");
// int x=sc.nextInt();
// if(x>=18){
// System.out.println("old hai bhai");
// }
// else{
// System.out.println("young hai bhai");
// }
// int a=5, b=6, c=9;
// if(a>b&&a>c){
// System.out.println("a bada hai");
// }
// else if(b>c){
// System.out.println("b bada hai");
// }
// else{
// System.out.println("c bada hai");
// }
// Scanner sc=new Scanner(System.in);
// System.out.println("enter karo bhai");
// int x=sc.nextInt();
// int y=sc.nextInt();
// int z=sc.nextInt();
// int t,avg;
// t=x+y+z;
// avg=t/3;
// System.out.println(avg);
// if(avg>=90)
// {System.out.println("a");}
// else if(avg>=80 && avg<90)
// {System.out.println("b");}
// else if(avg>=70 && avg<80)
// {System.out.println("c");}
// else if(avg>=60 && avg<70)
// {System.out.println("d");}
// else
// {System.out.println("e");}
// Scanner sc=new Scanner(System.in);
// System.out.println("enter karo bhai");
// String x=sc.nextLine();
// System.out.println(x);
// if(x.matches("[01]+"))
// {System.out.println("binary");}
// else if(x.matches("[0-8]+"))
// {System.out.println("octal");}
// else if(x.matches("[0-9]+"))
// {System.out.println("decimal");}
// else if(x.matches("[0-9A-F]+"))
// {System.out.println("hexa");}
// else{
// System.out.println("not number");
// Scanner sc=new Scanner(System.in);
// System.out.println("enter karo bhai year");
// int x=sc.nextInt();
// System.out.println(x);
// if(x%4==0)
// {if(x%100==0)
// {if(x%400==0)
// {System.out.println("leap year");}
// else{System.out.println("not leap year");}}
// else{System.out.println("leap year");}}
// else{System.out.println("no leap yr");}
// Scanner sc=new Scanner(System.in);
// System.out.println("enter karo bhai url");
// String x=sc.nextLine();
// String protocol=x.substring(0,x.indexOf(":"));
// if(protocol.equals("http"))
// {System.out.println("Hyper Text Transfer Protocol");}
// else if(protocol.equals("ftp"))
// {System.out.println("File Transfer Protocol");}
// String ext=x.substring(x.lastIndexOf(".")+1);
// if(ext.equals("org"))
// {System.out.println("Ogranization");}
// else if(ext.equals("com"))
// {System.out.println("commercial");}
// Scanner sc=new Scanner(System.in);
// System.out.println("enter karo bhai url");
// int n=sc.nextInt();
// switch(n){
// case 1: System.out.println("one");
// break;
// case 2: System.out.println("two");
// break;
// case 3: System.out.println("three");
// break;
// default : System.out.println("invalid");
// // }
// Scanner sc=new Scanner(System.in);
// System.out.println("enter karo bhai day");
// int day=sc.nextInt();
// switch(day){
// case 1: System.out.println("Sun");
// break;
// case 2: System.out.println("mon");
// break;
// case 3: System.out.println("tue");
// break;
// case 4: System.out.println("weds");
// break;
// case 5: System.out.println("thrus");
// break;
// case 6: System.out.println("fri");
// break;
// case 7: System.out.println("sat");
// break;
// default : System.out.println("invalid");
// }
// Scanner sc=new Scanner(System.in);
// System.out.println("enter karo bhai url");
// String url=sc.nextLine();
// String ext=url.substring(url.lastIndexOf(".")+1);
// switch(ext){
// case "com": System.out.println("commercial");
// break;
// case "net": System.out.println("network");
// break;
// case "org": System.out.println("organization");
// break;
// default : System.out.println("invalid");
// }
// Scanner sc=new Scanner(System.in);
// System.out.println("enter karo bhai num");
// int x=sc.nextInt();
// int y=sc.nextInt();
// System.out.println("enter option in words");
// String opt=sc.next();
// switch(opt){
// case "ADD": System.out.println(x+y);
// break;
// case "SUB": System.out.println(x-y);
// break;
// case "MUL": System.out.println(x*y);
// break;
// case "DIV": System.out.println(x/y);
// break;
// default : System.out.println("invalid");
// }
}
}