Repository navigation
Expand file tree
/
Copy pathac7.java
More file actions
245 lines (158 loc) · 4.88 KB
/
Copy pathac7.java
File metadata and controls
245 lines (158 loc) · 4.88 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
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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
//_____________________________________________________________________________________
//1)
// import java.util.*;
// public class ac7 {
// public static float avg ( int n,int n1,int n2){
// return ((n+n1+n2)/3);
// }
// public static void main(String [] args){
// int n,n1,n2;
// Scanner s= new Scanner(System.in);
// n=s.nextInt();
// n1=s.nextInt();
// n2=s.nextInt();
// System.out.println(avg(n,n1,n2));
// }
// }
// //_____________________________________________________________________________________
// //2)
// import java.util.*;
// public class ac7 {
// public static int sum_of_odd ( int n){
// int sum=0;
// for(int i=0;i<=n;i=i+2){
// sum+=i;
// }
// return sum;
// }
// public static void main(String [] args){
// int n;
// Scanner s= new Scanner(System.in);
// n=s.nextInt();
// System.out.println(sum_of_odd(n));
// }
// }
//_____________________________________________________________________________________
//3)
// import java.util.*;
// public class ac7 {
// public static float circumferance( int r){
// float x=3.14f;
// return (2*x*r);
// }
// public static void main(String [] args){
// int n;
// Scanner s= new Scanner(System.in);
// n=s.nextInt();
// System.out.println(circumferance(n));
// }
// }
//_____________________________________________________________________________________
//4)
// import java.util.*;
// public class ac7 {
// public static void check_eli( int age){
// if(age>=18)
// System.out.println("you are eligabale");
// else
// System.out.println("no you are not");
// }
// public static void main(String [] args){
// int age;
// Scanner s= new Scanner(System.in);
// age=s.nextInt();
// check_eli(age);
// }
// }
//_____________________________________________________________________________________
//4)
//_____________________________________________________________________________________
//5)
// import java.util.*;
// public class ac7 {
// public static void main(String [] args){
// int n;
// Scanner s= new Scanner(System.in);
// n=s.nextInt();
// do{
// System.out.println(n);
// }
// while(true);
// }
// }
//_____________________________________________________________________________________
//6)
// import java.util.*;
// public class ac7 {
// public static void main(String [] args){
// int n;
// Scanner s= new Scanner(System.in);
// int m;
// int positive=0,negative=0,zero=0;
// System.out.println("here 1 for more input and any other number for terminate");
// do{
// n=s.nextInt();
// if(n>0)
// positive++;
// else if(n<0)
// negative++;
// else zero++;
// m=s.nextInt();
// }
// while(m==1);
// System.out.println("positive"+positive);
// System.out.println("negative"+negative);
// System.out.println("zero"+zero);
// }
// }
//_____________________________________________________________________________________
//7)
// import java.util.*;
// public class ac7 {
// public static int power(int n,int x){
// if(x==1)
// return n;
// return n*power(n,x-1);
// }
// public static void main(String [] args){
// int n,x;
// Scanner s= new Scanner(System.in);
// n=s.nextInt();
// x=s.nextInt();
// System.out.println(power(n,x));
// }
// }
//_____________________________________________________________________________________
//8)
// import java.util.*;
// public class ac7 {
// public static int gcd(int n,int x){
// if(x==0)
// return n;
// return gcd(x,n%x);
// }
// public static void main(String [] args){
// int n,x;
// Scanner s= new Scanner(System.in);
// n=s.nextInt();
// x=s.nextInt();
// System.out.println(gcd(n,x));
// }
// }//_____________________________________________________________________________________
//9)
// import java.util.*;
// public class ac7 {
// public static int fibo(int n){
// if(n==1 || n==2){
// return 1;
// }
// return fibo(n-1)+fibo(n-2);
// }
// public static void main(String [] args){
// int n;
// Scanner s= new Scanner(System.in);
// n=s.nextInt();
// for(int i=1;i<=n;i++)
// System.out.print(fibo(i)+" ");
// }
// }