Ask Question
4 November, 18:49

How many times does the following loop body execute? int count = 52; for (int i = 0; i < count; i++) {cout << count << endl; --count; }

26

52

25

None of the above

+4
Answers (1)
  1. 4 November, 21:26
    0
    The correct option is (a) that is 26.

    Explanation:

    In the for loop,"i" started with 0 and the initial value of "count" is 52. In the First

    iteration it will print "52" as output. Then the value of "count" is decreased by 1 and become 51. So in the next iteration,"i" increased by 1 and become 1. then it will check i
    When we run this loop, we get 26 numbers from 52 - 27.

    52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27

    this is the output of the given loop.
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “How many times does the following loop body execute? int count = 52; for (int i = 0; i < count; i++) {cout ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers