help with loops and stuff

I am figuring out how to make my program display multiples of 3. would this code display multiples of 3?

1
2
3
4
5
while (n > 0 || n % 3)
{
	cout << n << ", ";
	--n;
}
No.

You could instead simply increment n by one each time and display n*3 ;)
Last edited on
Topic archived. No new replies allowed.