0
What is error in this program?
public class Program { public static void main(String[] args) { int m = 0; for(int i = 3;i<1000;i++){ if(i % 3 = 0 || i % 5 = 0){ System.out.print(i+","); m = m + i; } System.out.println (m); } } }
3 ответов
+ 2
you use single equal sign into the "if" statement.
but that should be double equal sign.like:
if(i%3==0 || i%5==0)
I think you understand.
0
Thanks Rony now my program is working.
0
welcome nayan.Anytime need help just knock me or send an email.