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
Post a Comment