cout/printf dont displaying correct output

hi im trying to solve a problem that requires to displays asteric per 100 but my function doesnt display nothing

1
2
3
4
5
6
void displayStars(int star)
{
	for (int counter=0; counter>star; counter+100) {
	printf("*");
	}
}


when I compile my code it skips this out and doesnt display any stars like id like it to
Last edited on
The middle part of the for loop is a condition for which the loop continues when it is true.
counter+100 effectively does nothing - it adds 100 to counter and discards the result.
Last edited on
Thanks I got it working
Topic archived. No new replies allowed.