#include<stdio.h>
main ()
{
int n, i, st;
char star;
printf("Enter the character:");
scanf("%c", &star);
printf("The time\n");
scanf("%d",&n);
for(i=1; i<=n;++i)
{
printf("%c\n",star);
for (st=1;st<=n;st++);
{
printf("%c",star);
}
}
}
Right now, my output is coming something like this:
*
**
**
**
**
*
#include<stdio.h>
main ()
{
int n, i, st;
char star;
printf("Enter the character:");
scanf("%c", &star);
printf("The time\n");
scanf("%d",&n);
for(i=0; i<n;++i)//remove =, i=0
{
//printf("%c\n",star);//<<< remove this
for (st=0;st<=i;st++)//<<< remove semicolon, i instead of n st=0
{
printf("%c",star);
}
printf("\n",0);//<<< add this
}
}