Answers for "pyramid of numbers number pyramid pattern"

0

pyramid of numbers number pyramid pattern

#include <stdio.h>
#include <stdlib.h>

int main()
{
    int rows,i,j,k,l=1;
    printf("Enter number of rows you want: ");
    scanf("%d",&rows);
    printf("Pyramid pattern 1\n");
    for(i=1; i<=rows; i++){
        for(j=1; j<=rows-i; j++){
            printf(" ");
        }
        for(k=1; k<=i; k++, l++){
            printf("%d ",l);
        }
        printf("\n");
    }
    return 0;
}
Posted by: Guest on August-02-2021

Code answers related to "pyramid of numbers number pyramid pattern"

Browse Popular Code Answers by Language