Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.company;
- /*
- Amon Guinan
- Wednesday, January 23, 2019
- Program calculates the sum of the first four factors of seven.
- */
- public class six_twentyFour {
- public static void main(String [] args)
- {
- int sum;
- int mults_of_7 = 0;
- int count = 1;
- while(count <= 4)
- {
- sum = count * 7;
- System.out.println(count+" : "+sum);
- count = count +1;
- mults_of_7 = mults_of_7 + sum;
- }
- System.out.print("Sum: "+mults_of_7);
- }
- }
Add Comment
Please, Sign In to add comment