This is what you can do-
#include <stdio.h>
int main()
{
int num_rows, num_symbols, i, j;
printf("How many rows for your star design?\n");
scanf("%d", &num_rows);
printf("How many stars on the first row?\n");
scanf("%d", &num_symbols);
for(i=0;i<num_rows;i++)
{
if(i%2==0)
for(j=num_symbols;j>0;j--)
printf("* ");
else
for(j=num_symbols;j>1;j--)
printf(" *");
printf("\n");
}
return 0;
}
Good luck!
1
solved How many rows for your star design? [closed]