Repository navigation
Expand file tree
/
Copy pathpractice1.java
More file actions
82 lines (58 loc) · 2.05 KB
/
Copy pathpractice1.java
File metadata and controls
82 lines (58 loc) · 2.05 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
//TODO:sum of three num
// import java.util.Scanner;
// public class practice1 {
// public static void main(String[]args) {
// int num,num1,num2;
// Scanner s= new Scanner(System.in); //! here is scannner is a class system.in is a method
// num=s.nextInt(); //? nextInt is a method
// num1=s.nextInt();
// num2=s.nextInt();
// System.out.println(num+num1+num2);
// }
// }
//TODO : count percentage of 5 sub
// import java.util.Scanner; //! must require to access scanner class
// public class practice1 {
// public static void main(String[]args) {
// int marks;
// int sum=0;
// Scanner s= new Scanner(System.in); //! here is scannner is a class system.in is a method and we creat object s to acces this class
// //? nextInt is a method
// for(int i=0;i<5;i++){
// marks=s.nextInt();
// sum+=marks;
// }
// float per=sum/5;
// System.out.println(per+"%");
// }
// }
// //TODO : take user name and greeting them
// import java.util.Scanner; //! must require to access scanner class
// public class practice1 {
// public static void main(String[]args) {
// String name;
// Scanner s= new Scanner(System.in);
// name=s.next();
// System.out.println(name+" "+" hello ... good morning ");
// }
// }
//TODO : convert kilometer to miles
// import java.util.Scanner; //! must require to access scanner class
// public class practice1 {
// public static void main(String[]args) {
// float kilo_m,miles;
// Scanner s= new Scanner(System.in);
// kilo_m=s.nextFloat();
// System.out.println(kilo_m*0.62);
// }
// }
//TODO : check number is integer or not
import java.util.Scanner; //! must require to access scanner class
public class practice1 {
public static void main(String[]args) {
int n;
Scanner s= new Scanner(System.in);
//n=s.nextInt();
System.out.println(s.hasNextInt()); //! hsNextInt() method use for check number is int or not
}
}