Reputation: 1
import java.util.Scanner;
class TriNumbers {
public static void main(String args[]) {
int Count1=1, Count2=0;
while (Count1>=1 Count2=0) {
System.out.println(Count2+=Count1+"");
}
}
}
Upvotes: 0
Views: 181
Reputation: 68715
You are missing &&
in between two comparisons:
Count1>=1 Count2=0
should be
Count1>=1 && Count2=0
Also you are using single =
which is for assignment. Use ==
for comparison. So finally this should be your condition:
while (Count1>=1 && Count2==0)
Note: You may have to replace &&
with some other operator(||, != etc). I just used it for example.
Upvotes: 1
Reputation: 25725
while(Count1>=1 Count2 = 0)
<- here is the error.. makes no sense absolutely.
What are you trying to do?
Upvotes: 0