Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- package DoWhile;
- public class Do {
- public static void main(String[] args) {
- Scanner leer = new Scanner(System.in);
- int opcion , n1 , n2 , res;
- do{
- System.out.println("1.- Suma de dos numeros");
- System.out.println("2.- Multiplicacion de dos numeros");
- System.out.println("0.- Salir");
- System.out.println("1.- Selecciona una opcion");
- opcion = leer.nextInt();
- switch(opcion)
- {
- case 1: System.out.print("Dame el primer numero :"); n1 = leer.nextInt();
- System.out.print("Dame el segundo numero :"); n2 = leer.nextInt();
- res= n1+ n2;
- System.out.print("El resulado de la suma es : "+res);n1 = leer.nextInt();
- break;
- case 2:
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement