Time remaining:
please help

Programming
Tutor: None Selected Time limit: 0 Hours

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

Studypool's Notebank makes it easy to buy and sell old notes, study guides, reviews, etc.
Click to visit
The Notebank
...
Oct 18th, 2013
...
Oct 18th, 2013
Dec 10th, 2016
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