In this tutorial, we are going to write a Java program to find the sum of all integers greater than 100 and less than 200 that are divisible by 7 in Java Programming with practical program code and step-by-step full complete explanation.

Java program to find the sum of integers divisible by 7


Java program to find the sum of integers divisible by 7

 
class SumOfDigit
{
    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);
    }
}


Output

 
Output of Program is : 2107