Site icon Matistics

C – Program to print the RIGHT Half of the PYRAMID

print the following patterns- The right half of the pyramid

#include<stdio.h>
int main(){
int a,b;
printf("No of rows: ");
scanf("%d",&a);
for(int i=1;i<=a;i++){
for(int j=a;j>i;j--){
printf(" ");
}
for(int k=0;k<i;k++){
printf("*");
}
printf("\n");
}
}
Exit mobile version