If the value of variable num is 30, how many times will the following while loop be executed? while (num <= 30) { ... statements ... num = num + 3; }
Answers
Answered by
0
Answer:
I am prerna Puri is very important to us about your experience of working with
Answered by
0
The loop will be executed only one time.
EXPLANATION:
- While loop is a pre-test kind of loop. It will work when the condition turns to be True.
- In the given condition it says, while num<=30, so the loop will work if the value of num will be less than or equal to 30.
- It is given that the value of num is 30. So, it will work once and give the output as per the program. Loop will run once as the condition will be true once that num=30.
Similar questions
English,
6 months ago
English,
6 months ago
English,
6 months ago
Computer Science,
1 year ago
Computer Science,
1 year ago
Math,
1 year ago
Math,
1 year ago