I\'m having problems with this code. I don\'t want to look at others, so I\'m wondering what\'s wrong with mine.
If we list all the natural numbers below 10 that are mu
just write this simple java code.
public static void main(String[] args) { int i,sum=0; for ( i = 3; i <1000; i++) { if ((i % 3 == 0)||(i%5==0) ) sum=sum+i; } System.out.print(sum); }
You will get the output as 233168