Pyramid pattern A in c language

#include<stdio.h>
int main()
{
int i, j;
for(i=0; i<=4; i++)
{
for(j=0; j<=4; j++)
{
if(i>j)
{
printf(" “);
}
else{
printf(“A”); }
}
printf(”\n");
}
return 0;
}

You’re code works fine for a 'semi’pyramid
As for a complete pyramid, the pyramid number n should be an odd number

Here you go:
#include<stdio.h>
#include<math.h>

int main()
{
int pyramid_n=13;   // Replace this number with your choice
int i,j;
int mid=pyramid_n/2;

for(i=0; i<=pyramid_n-1; i++)
{
for(j=-((pyramid_n/2)-1); j<=pyramid_n+pow(2,pyramid_n/2); j++)
{
    
if(j>=mid-i+1&&j<=mid+i+1) printf("A"); 
else printf(" ");

}
printf("\n");
}

return 0;
}