write a java program to print the sum of the multiples of 3 till n term
Answers
Answered by
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
Physics,
3 months ago
Social Sciences,
10 months ago
English,
10 months ago
Sociology,
10 months ago