fork download
  1. /**
  2.  *
  3.  * @author Damien Bell <[email protected]>
  4.  */
  5.  
  6.  
  7. import java.util.Scanner;
  8. class Jtutorial1 {
  9. public static int prodSum(int x, int y){
  10. int z=0;
  11. System.out.println("The product is: " +(x*y)); // produdct of our numbers
  12. z= x+y;
  13. return z;
  14. }
  15. public static void main(String args[]){
  16. Scanner input = new Scanner(System.in);
  17.  
  18. int j=0, k=0, sum;
  19. for(int i=0; i< 2; i++){
  20. System.out.println("Enter number 1: ");
  21. j= input.nextInt();
  22. System.out.println("Enter number 2: ");
  23. k=input.nextInt();
  24.  
  25. sum = prodSum(j,k);
  26. System.out.println("The sum is: "+ sum);
  27. }
  28.  
  29. } //End main
  30. } //End class
Not running #stdin #stdout 0s 0KB
stdin
Standard input is empty
stdout
Standard output is empty