Ask Question
1 June, 13:14

If you want a user to enter exactly 20 values, which loop would be the best to use?

1. do-while

2. while

3. for

4. infinite

5. None of these

+3
Answers (1)
  1. 1 June, 13:20
    0
    Answer: For loop

    Explanation:

    Using the for loop we can get the exact number of values/outcomes we require.

    For example: printf (enter 20 numbers");

    for (int i=0; i<20; i++)

    {

    scanf ("%d", &number);

    }

    So, this is an implementation of for loop in C. Using it we can enter exact 20 numbers not less or more than that.

    Therefore, for loop is the answer.
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “If you want a user to enter exactly 20 values, which loop would be the best to use? 1. do-while 2. while 3. for 4. infinite 5. None of these ...” 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