Click the Follow Button

number pyramid

 PROGRAM:

#include<stdio.h>

int main ()
{
    int n;
    printf("enter the number: ");
    scanf("%d", &n);
    for(int i = 1; i <= n; i++ )
    {
        for (int j = 1; j <= i; j++)
        {
            printf("%d", i);
        }

        printf("\n");
       
    }

    return 0;
}

OUTPUT:

enter the number: 5

1

22

333

4444

55555

Comments

Popular Posts

TIC - TAC - TOE

Prime and not prime number

do_while loop is to do something again and again