write a program to printing following pattern in c.



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

 

1 2 

1 2 3  

1 2 3 4 

1 2 3 4 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 "j);
        }

        printf("\n");
    }

    return 0;

    getch();
}

OUTPUT
enter a value: 5

 

1 2 

1 2 3  

1 2 3 4 

1 2 3 4 5

Follow our page for regular updates.

0 Comments