void DrawStairs() {
// Declare Variable i
int i = 0;
// while loop
while (i == 0){
//Increment Variable
i + 1;
//Print # (Should print 8 times but it's not)
cout << "#\n";
if (i == 8)
break;
}
printf("\n\n\n\n\n\n\n\n\n\n%d", i);
The code above on compiler explorer just prints # forever. If i change the if to if (i = 8) Then it will break when i = 8 but it will only print # once. I want it to print # 8 times. How do I accomplish this?