Produce the following output:

This post content:-
Algorithm
Flowchart
C code
Output
Pdf notes

Algorithm:-
Step 1:- start.
Step 2:- declare variable int i,j,k, count=1;
Step 3:- make the for Loop for all the rows.
for(i=1;i<=4;i++)
    {
        //add left space for pattern
        for(j=1;j<=4-i;j++)
        {
            printf("*");
        }

Step 4:- add element after space.
for(k=1;k<=i;k++)
        {
            printf(" %d",count);
            count++;
        }

    printf("\n");
Step 5:- END.

Flowchart:-

C code:-
Output:-
Try it yourself:-

Comments

Popular posts from this blog

Develop and execute C Program to Add Two Distances given in kilometer-meter Using Structures.

Develop a c program to find the sum of all elements stored in a given array using a pointer.