Simplest way to learn C language: Best and simplest Algorithm to understand iterative & nested If condition

Now lets try and understand Algorithm of nested if condition and iterative if condition

Nested if else condition for finding the highest among the three numbers a, b and c.
  1. Start.
  2. Accept the value a, b, c.
  3. If a>b and a>c then
  4. Display a as greatest.
  5. Go to step 14.
  6. If a>b and a
  7. Display c as greatest.
  8. Go to step 14.
  9. If a<b and b>c then
  10. Display b as greatest.
  11. Go to step 14.
  12. If a
  13. Display c as greatest.
  14. End.
Now in the above algorithm even if the values of a and b or a and c or either of two values or all values of a,b and c are equal we can get the answer through it.
Through if condition we can work out the algorithm of Tables
  1. Start.
  2. Accept the value of a.
  3. Let b = 1.
  4. c = a × b.
  5. Express (display or print) c.
  6. Increment value of b by 1.
  7. If b <= 10 then go to step 4.
  8. If b >= 11 then go to step 9.
  9. End.
Focus on the above algorithm and remember that step 4, 5 and 6 are repeated till the value of b < 10 and as b goes beyond 10, step 8 executes and algorithm terminates. As you can observe carefully the recurrence of step 4, 5 and 6 is due to variance in the value of b. b is initialized in step 3, condition is checked for b in step 7 and value of b is incremented in step 6

Hack Facebook online psp,xbox games Hack Facebook Online

No comments:

Post a Comment