Hello ,
I'm trying to coding for making an empty tringle with all side with stars. Anyone help me to correct it ?
Code:#include<stdio.h> void main() { int n,i,l; scanf("%d",&n); for(i=1;i<=n;i++) { for(l=1;l<=n-i;l++) { printf(" ");} if(i<=n) { printf("*");} if(1<i<n) { for(l=1;l<=2*i-3;l++) {printf(" ");}} if(1<i<n) { printf("*");} if(i==n) { for(l=1;l<=2*i-2;l++) printf("*"); } printf("\n"); } }