Computer Science, asked by ranichoudhary793, 6 months ago

write a java program to print the sum of the multiples of 3 till n term​

Answers

Answered by fortniteamanid
1

Explanation:

public class Multithree {

public static void main(String[] args) {

// TODO Auto-generated method stub

ArrayList<Integer> x = new ArrayList<Integer>();

ArrayList<Integer> y = new ArrayList<Integer>();

int totalforthree = 0;

int totalforfive = 0;

int total =0;

for(int temp =0; temp < 1000 ; temp++){

if(temp % 3 == 0){

x.add(temp);

totalforthree += temp;

}

}

Similar questions