Java Program To Find Sum Of Integers Between 100 And 200 And Divisible By 7

Chapter: Interview Programs Last Updated: 14-06-2016 15:42:25 UTC

Program:

            /* ............... START ............... */
                
public class JavaSumOfIntegersInRange {

	public static void main(String args[]) {

		int result = 0;

		for (int i = 100; i <= 200; i++) {

			if (i % 7 == 0)

				result += i;

		}

		System.out.println("Output of Program is : " + result);
	}
}

                /* ............... END ............... */
        

Output

Output of Program is : 2107

Tags

Find Sum Of Integers Between 100 And 200 And Divisible By 7 , Java, Interview Programs

Similar Programs Chapter Last Updated
Java Program To Check List Having Common Values In List Interview Programs 17-05-2023
Java Program To Convert Number Of Days Into Months And Days Interview Programs 14-06-2016
Java Program To Find Minimum Of Two Numbers Using Conditional Operator Interview Programs 14-06-2016
Java Program To Print Calendar Of Month Interview Programs 13-06-2016

1