-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathjavaexercises.java
More file actions
34 lines (19 loc) Β· 809 Bytes
/
javaexercises.java
File metadata and controls
34 lines (19 loc) Β· 809 Bytes
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
import java.util.*;
class javaexercises {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
//------------------ Exercise 1 ---------------------
// ----> Take input and print like (n+nn+nnn)
System.out.println("Enter your number : ");
String num=sc.next();
System.out.println(num);
// int sum=0;
// System.out.println("Enter an integer : ");
// String num=sc.nextLine();
// for (int i=0;i<num.length();i++) {
// sum=sum+num.charAt(i);
// }
// System.out.println("The sum is "+sum);
// -----> (16) ------> Print Face - ---> ( Escape Character Sequence )
}
}