Time remaining:
please help

label Programming
account_circle Unassigned
schedule 0 Hours
account_balance_wallet $5

ONE HUGE QUESTION

how do you write follow your parent but you can jump your parent to follow your grandparent but you can also jump him to to follow your up-line so on so on

Oct 18th, 2013

Using switch statement or using nested loops with break statement.

Say,there are N loops with loop 1 representing parent,loop2 for granparent and so on up the line.

while(condition N)

{

   code for loop N;

  printf("follow your first greatest ancestor");

          while(condition N-1)

              {

       code for loop N-1;

       printf("follow your second greatest ancestor");

                    .

                    .

           while(condition 2)

             {

             code for loop 2;

               printf("follow your grandparent");

                   while(condition 1)

                             {

                         printf("follow your parent");

                         code for loop 1;

                         printf("jump your parent");

                          break;

                               }

         printf("jump your grandparent");

          break;

        }

      .

      .

      printf("jump your second greatest ancestor");

      break;

         }

printf("This is your first ancestor,you cant jump anymore!");

break;

}

Nov 10th, 2014

Did you know? You can earn $20 for every friend you invite to Studypool!
Click here to
Refer a Friend
...
Oct 18th, 2013
...
Oct 18th, 2013
Oct 23rd, 2017
check_circle
Mark as Final Answer
check_circle
Unmark as Final Answer
check_circle
Final Answer

Secure Information

Content will be erased after question is completed.

check_circle
Final Answer