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); } } }

13th Nov 2016, 2:45 PM
nayan
nayan - avatar
3 Answers
+ 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.
13th Nov 2016, 2:51 PM
Rony CSE
Rony CSE - avatar
0
Thanks Rony now my program is working.
13th Nov 2016, 2:54 PM
nayan
nayan - avatar
0
welcome nayan.Anytime need help just knock me or send an email.
13th Nov 2016, 2:55 PM
Rony CSE
Rony CSE - avatar