Java Program to find the sum of all the multiples of 3 and 5 below 1000


 

// Program by Akash Tripathi (@proakash256)
  
public class Multiples_3_5
{
    public static void main(String args[])
    {
        int sum = 0;
        for(int i = 1i < 1000i = i + 1)
        {
            if(i % 3 == 0 || i % 5 == 0)
            {
                sum = sum + i;
            }
        }
        System.out.printf("%d" , sum);
    }
}

Comments