Skip to content

pc001.c

Problem Statement

Pattern : 1 1 2 1 2 3 1 2 3 4 1 2 3 4 5 for n = 5

Metadata

Property Detail
Author Amit Dutta (amitdutta4255@gmail.com)
License MIT

Actions

Raw View on GitHub

💡 You can print or save this file by opening Raw and using your browser.

Source Code

#include <stdio.h>
int main()
{
    int i, j, num;
    printf("Enter n : ");
    scanf("%d", &num);
    for (i = 1; i <= num; i++)
    {
        for (j = 1; j <= i; j++)
        {
            printf("%d\t", j);
        }
        printf("\n");
    }
    return 0;
}