-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathingresar_datos.java
More file actions
29 lines (19 loc) · 789 Bytes
/
ingresar_datos.java
File metadata and controls
29 lines (19 loc) · 789 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
import java.util.Scanner;
public class ingresar_datos {
@SuppressWarnings("resource")
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
String nombre = "";
int resultado = 0, num1 = 0, num2 = 0, num3 = 0;
System.out.println("cual es tu nombre: ");
nombre = in.nextLine();
System.out.println("dame el primer valor para tu suma: ");
num1 = in.nextInt();
System.out.println("dame el segundo valor para tu suma: ");
num2 = in.nextInt();
System.out.println("dame el tercer valor para tu suma: ");
num3 = in.nextInt();
resultado = (num1 + num2 + num3);
System.out.println("hola" + nombre + "el resultado es de tu suma es " + resultado);
}
}