//NATURALS NUMBERS THAT ARE DIVISIBLE BY 7 & 8
import java.io.*;
class ssvnat
{
public static void main(String arg[]) throws IOException
{
int i,a,b,s=0,start,end;
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
System.out.println("\n\t\t*** NATURALS NUMBERS THAT ARE DIVISIBLE BY 7 & 8 *** \n");
System.out.print("Enter the number will be started : ");
start=Integer.parseInt(br.readLine());
System.out.print("Enter the number to be end : ");
end=Integer.parseInt(br.readLine());
for(i=start;i<=end;i++)
{
a=i%7;
b=i%8;
if((a==0)&&(b==0))
{
System.out.print("\t" + i);
s=s+i;
}
}
System.out.print("\n\nThe Sum of Numbers that are divisible by 7 and 8 : " + s);
System.out.println();
}
}In this program, easy to understand to calculate natural numbers that are divide by 7 & 8 using Java Program
