-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSolutions.java
More file actions
97 lines (95 loc) · 2.39 KB
/
Solutions.java
File metadata and controls
97 lines (95 loc) · 2.39 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
/*
import java.util.*;
public class Solutions{
public static void CheckAge(int a){
if(a>=18){
System.out.println("You can Vote");
}else{
System.out.println("You cant vote");
}
}
public static void main(String args[]){
Scanner sc = new Scanner(System.in);
System.out.println("Enter the age");
int a = sc.nextInt();
CheckAge(a);
}
}
*/
/*
import java.util.*;
public class Solutions{
public static boolean IsAge(int age){
if(age>=18){
return true;
}
return false;
}
public static void main(String args[]){
Scanner sc = new Scanner(System.in);
int age = sc.nextInt();
System.out.println((IsAge(age)));
}
}
*/
/*
import java.util.*;
public class Solutions{
public static void main(String args[]){
do{
}
while(true);
}
}
*/
/*
import java.util.*;
public class Solutions{
public static void main(String args[]){
int positive = 0 ;
int negative = 0 ;
int zero = 0;
System.out.println("Press 1 to continue and 0 to stop");
Scanner sc = new Scanner(System.in);
int input = sc.nextInt();
while(input == 1){
System.out.println("Enter your number : ");
int number = sc.nextInt();
if(number > 0){
positive ++;
}else if(number < 0){
negative ++;
}
else{
zero ++;
}
System.out.println("Press 1 to continue and 0 to stop");
input = sc.nextInt();
}
System.out.println("Positive is " + positive);
System.out.println("Negative is " + negative);
System.out.println("Zero " + zero);
}
}
*/
/*
import java.util.*;
public class Solutions{
public static void PowerChck(int x , int n){
int result = 1;
for(int i = 0; i<n ; i++){
result = result * x;
}
System.out.println(x + " to the power " + n + " is " + result);
}
public static void main(String args[]){
Scanner sc = new Scanner(System.in);
System.out.println("Enter the x" );
int x = sc.nextInt();
System.out.println("Enter the n");
int n = sc.nextInt();
//System.out.println((PowerChck(x, n)));
PowerChck(x, n);
}
}
*/