Menu
Question Index
...

Write a program to find the sum of the numbers divisible by 3 or 4 between two given numbers.

Input Range Output
10 to 20 12 + 15 + 16 + 18 + 20 = 81
NOTE: Although 12 is divisible by 3 and 4, it should be added only once
200 to 215 200 + 201 + 204 + 207 + 208 + 210 + 212 + 213 = 1655



class SumOfNumbersDivisibleByThreeAndFour
{
    public static void main(String s[])
    {
        System.out.println("Sum of matched numbers between 10 and 20 is " + sum_of_matched_numbers(10, 20));

    }


    public static int sum_of_matched_numbers(int start, int end)
    {
        int output = 0;
        return output;
    }

}

Doubts

Problems

Topic: for Loop In Java

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App