Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. import java.util.*;
  2. public class sample4
  3. {
  4. static Scanner section4 = new Scanner(System.in);
  5. public static void main(){
  6. int num1,num2,sum;
  7. System.out.print("Enter value of first number: ");
  8. num1 = section4.nextInt();
  9.  
  10. System.out.print("Enter value of second number: ");
  11. num2 = section4.nextInt();
  12.  
  13. sum = num1+num2;
  14.  
  15. System.out.printf("The sum of %d and %d is %d",num1,num2,sum);
  16.  
  17. }
  18.  
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement