C
c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include <stdio.h>
int main() {
int i,j,rows;
printf("Enter number of rows ;\n\n");
scanf("%d",&rows); // This was your problem as scanf quotes only needs to be around "%d" not "%d, &rows"
for(i=1;i<=rows;i++){
for(j=i;j<rows;j++){
printf(" ");
}
for(j=1;j<=(2*i-1);j++){
if(i==rows || j==1 || j==(2*i-1)){
printf("*");
} else{
printf(" ");
}
}
printf("\n");
}
return 0;
}
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run