Write a program to find the number of and sum of all integers greater than 100 and less than 200 that are divisible by 2?

1 answer

Answer

1109962

2026-07-11 16:20

+ Follow

public static void main(String[] args) { int count = 0; int sum = 0; for(int i = 100; i < 200; i++) { if(i%7 == 0){ System.out.println(i); count++; sum = sum + i; } } System.out.println("Number of values divisble by 7 is: " + count); System.out.println("Sum of the values divisible by 7 is: " + sum); }

ReportLike(0ShareFavorite

Related Questions

Copyright © 2026 eLLeNow.com All Rights Reserved.