How many times will the following loop will be executed: int num1 = 5, num2 = 30; do num1 += 5; while(num1 < num2); O 1. 7 O 2. 4 O 3. 6 O 4. 5

Programming Logic & Design Comprehensive
9th Edition
ISBN:9781337669405
Author:FARRELL
Publisher:FARRELL
Chapter5: Looping
Section: Chapter Questions
Problem 9RQ
icon
Related questions
Question
How many times will the following loop will be executed:
int num1 = 5, num2 = 30;
do
num1 += 5;
while(num1 < num2);
O 1.
7
2. 4
O 3. 6
O 4. 5
Transcribed Image Text:How many times will the following loop will be executed: int num1 = 5, num2 = 30; do num1 += 5; while(num1 < num2); O 1. 7 2. 4 O 3. 6 O 4. 5
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Basics of loop
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,