Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- *Self Check 3.3 #25
- *
- * Zain Arfi
- * v1
- */
- import java.util.*;
- public class Pg188_25
- {
- public static void main(String [] args)
- {
- Scanner console = new Scanner(System.in);
- System.out.println("What is low?");
- int low= console.nextInt();
- System.out.println("What is high?");
- int high = console.nextInt();
- int sum = 0;
- for(int i = low; i <= high; i++)
- {
- sum+=i;
- }
- System.out.println("sum=" + sum);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement