Ask Question
25 August, 06:37

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. 25 August, 07:22
    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?
Find 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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers