public class SumOfNo {
public static void main(String[] args) {
int sum = 0;
System.out.println("Number between 100 to 200 divisible by 7");
for (int i = 100; i <= 200; i++) {
if (i % 7 == 0) {
System.out.print(i + ",");
sum = sum + i;
}
}
System.out.println();
System.out.println("Sum of number="+sum);
}
/* ADD YOUR CODE HERE */
}
Responses
0 Respones to "31. Write a program to find the number of and sum of all integers greater than 100 and less than 200 that are divisibly by 7."
Post a Comment