SUMA DE 4 NUMEROS
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package suma.de.pkg4.numeros;
import java.util.*;
/**
*
* @author Sebastian Pinilla
*/
public class SumaDe4Numeros {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
Scanner stdin=new Scanner(System.in);//Metodo para lectura
System.out.println("Digite el primer numero");
System.out.println("Digite el segundo numero");
System.out.println("Digite el tercer numero");
System.out.println("Digite el cuarto numero");
int a=stdin.nextInt();
int b=stdin.nextInt();
int c=stdin.nextInt();
int d=stdin.nextInt();
int Sum=a+b+c+d;
System.out.println("El resultado de la suma entre "+a+"y"+b+"y"+c+"y"+d+"Es=" +Sum);
// TODO code application logic here
}
}
No hay comentarios:
Publicar un comentario