I am trying to do the Mario problem with C. The issue is that I want the user to select a number from 1 to 8. So my boolean expression is (n < 9 && n > 0).
But I don't know why is not working. And without the do while loop I don't see any other way to complete the task. I am stuck here. Here is the code.
What I am doing wrong?
Thanks in advance.
#include <stdio.h>
#include <cs50.h>
int main(void)
{
int n;
do
{
n = get_int("Height: ");
}
while (n < 9);
for (int i = 0 ; i <= n ; i++)
;
{
printf("#\n");
}
}