write a program to printing following pattern in c.



QUESTION:- write a program to printing following pattern in c. 

 

2 2  

3 3 3  

4 4 4 4 

5 5 5 5 5 

 

#include <stdio.h>

#include <conio.h>

int main()

{

    int ijno;

    printf("enter a value: ");

    scanf("%d", &no);

    for (i = 1i <= noi++)

    {

        for (j = 1j <= ij++)

        {

            printf("%d "i);
        }

        printf("\n");
    }

    return 0;

    getch();
}

 

OUTPUT

enter a value: 5

2 2

3 3 3

4 4 4 4

5 5 5 5 5


Follow our page for regular updates.

0 Comments