-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path26_InputProgram6.java
More file actions
38 lines (36 loc) · 918 Bytes
/
26_InputProgram6.java
File metadata and controls
38 lines (36 loc) · 918 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
35
36
37
38
/*
* Program of input from InputStreamReader
When we
*/
package javaprograms;
import java.io.*;
/**
*
* @author Geeky Keshav
*/
public class InputProgram6
{
public static void main(String [] args)throws Exception
{
InputStreamReader obj=new InputStreamReader(System.in);
BufferedReader obj1=new BufferedReader(obj);
int a;
int b;
int c;
int d;
System.out.print("Enter a number: ");
a=Integer.parseInt(obj1.readLine());
System.out.print("Enter 2nd number: ");
b=Integer.parseInt(obj1.readLine());
System.out.print("Enter 3rd number: ");
c=Integer.parseInt(obj1.readLine());
d=(a+b+c);
System.out.println("Sum of all these numbers is: "+d);
}
}
/*****OUTPUT****
Enter a number: 25
Enter 2nd number: 36
Enter 3rd number: 45
Sum of all these numbers is: 106
*/