Advertisement
zainarfi00

Unit 3.3 Self Check

Oct 3rd, 2015
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1.  
  2. /**
  3. *Self Check 3.3 #25
  4. *
  5. * Zain Arfi
  6. * v1
  7. */
  8. import java.util.*;
  9. public class Pg188_25
  10. {
  11. public static void main(String [] args)
  12. {
  13. Scanner console = new Scanner(System.in);
  14. System.out.println("What is low?");
  15. int low= console.nextInt();
  16. System.out.println("What is high?");
  17. int high = console.nextInt();
  18. int sum = 0;
  19. for(int i = low; i <= high; i++)
  20. {
  21. sum+=i;
  22. }
  23. System.out.println("sum=" + sum);
  24. }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement