Pyramid Problem No. 73

 Q.73 Write a C program to print the following number pyramid:

1
123
12345
1234567

Solving in C:

#include <stdio.h>
    int main(){
        int n=4,row,col;
        for(row=1; row<=n; row++){
            for(col=1; col<=2*row-1; col++) printf("%d",col);
            printf("\n");
        }
        return 0;
    }

Comments

Popular posts from this blog

Pyramid Problem No. 90

Pyramid Problem No. 74

Pyramid Problem No. 85