Differ Symbol Pyramid

Q. write C program to print the following symbol pyramid as:



/*c program for symbol pyramid*/
int main()
 int num,r,c;
 printf("Enter no. of rows : ");
 scanf("%d", &num);
 for(r=1; r<=num; r++)
   for(c=1; c<=r; c++)
        printf(" $");
        printf(" *");
 return 0;

The output of above program would be:

Output of differ symbol pyramid C program
Figure: Screen shot for differ-symbol pyramid C program

No comments:

Post a Comment