#include <stdio.h>
int main () {
int row, i, j;
printf("Enter a number: ");
scanf("%d", &row);
for (i=1; i<=row; i ) {
for (j=1; j<=row; j ) {
if (i==1 || i==row || i j==row 1) {
printf("*");
}
else
{
printf(" ");
}
}
printf("\n");
}
printf("\n\n");
}
return 0;
}
The program prints out the letter "Z" out of stars. I have to add a do-while loop in this. (This is for school, you can clearly see that I'm a begginer.)
CodePudding user response:
Perhaps this is what you want:
do {
printf("Enter a number: ");
scanf("%d", &row);
if (row < 4) puts("Try again");
} while (row < 4);
CodePudding user response:
like that?
printf("Enter a number:");
do{
scanf("%d",%row);
}while(row<4);