Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package pruebas;
- import java.util.Scanner;
- /**
- *
- * @author MasterRace
- */
- public class Pruebas {
- /**
- * @param args the command line arguments
- */
- public static void main(String[] args) {
- Scanner teclado = new Scanner(System.in);
- int x=0;
- int y=0;
- System.out.println("Introduce x: ");
- x = teclado.nextInt();
- System.out.println("Introduce y: ");
- y = teclado.nextInt();
- System.out.println(suma(x,y));
- int i=0;
- int j=0;
- System.out.println("Introduce i: ");
- i = teclado.nextInt();
- System.out.println("Introduce j: ");
- j = teclado.nextInt();
- System.out.println(suma(i,j));
- }
- public static int suma(int x, int y)
- {
- return x+y;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement