this was our Exam question , 20 points .
firstly you should, do this.
Code:
char a;
enter a height of pyramid=n,
after do a for(i=0;i<n;i++){
a='A'
printf spaces = for(i4=;i4<(n-i);i4++) printf(" ") times
put a for loop again for(i2=0;i2< i+1;i2++) printf("%c",a+i2); //you printed the half vertical pyramid
after, put a foor loop again and for(i3=0;i3<i;i++) printf("%c",a-1-i);
printf("\n");
}
firstly if n=3
spaces will be put ,after the letters and ,after other half of pyramid(the letters after ".", this is my algoritm,Not assume that there is no "." in the below shape.
A
AB.A
ABC.BA