0

Good. I am glad you could explain me your dynamism correctly. Your question is already been answered by Ancient Dragon in post#14.

Besides, your problem is that whenever your length of the array changes, you need to have to type a new loop, Right? So why not put the whole thing in a bigger loop and do the dynamics.
I have coded the whole thing and generated the correct output.

A sample would help:

for (int i=0;i<N;i++)
/* This loop will track the number of times the plus sign would come*/
    {

        for (int k=0;k<N-i;k++)
 /*Loop to count how many times each of the set of similar length (having same number of plus sign) to be printed*/
        {
           /*write the code to print arr[k] here. your self*/
            for (int j=0;j<i;j++)
/*This loop will add a plus sign and next element.
            {
               /*write code to print a plus sign immediately followed by a[j+k+1] */
            }
            /*write code to print a new line. i.e. '\n' */

        }
    }

Try to figure out what the above code does. And only after giving all up, ask us.

BTW, my output is coming as:

10
20
30
40
50
60
70
10+20
20+30
30+40
40+50
50+60
60+70
10+20+30
20+30+40
30+40+50
40+50+60
50+60+70
10+20+30+40
20+30+40+50
30+40+50+60
40+50+60+70
10+20+30+40+50
20+30+40+50+60
30+40+50+60+70
10+20+30+40+50+60
20+30+40+50+60+70
10+20+30+40+50+60+70
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.