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