Computer Applications
Which of the following are entry controlled loops?
(a) for
(b) while
(c) do..while
(d) switch
- only a
- a and b
- a and c
- c and d
Java Iterative Stmts
ICSE 2024
2 Likes
Answer
a and b
Reason — An entry-controlled loop checks the loop condition before executing the loop's body. If the condition is false at the start, the loop's body will not execute even once.
for and while loops check the condition before running the loop's body. If the condition is false, the loop won't run. Therefore, they are entry controlled loops.
The body of the do-while loop executes at least once before checking the condition. Hence, it is an exit controlled loop.
Answered By
1 Like
Related Questions
The number of bytes occupied by a character array of four rows and three columns are:
- 12
- 24
- 96
- 48
Which of the following data type cannot be used with switch case construct?
- int
- char
- String
- double
Method which reverses a given number is:
- Impure method
- Pure method
- Constructor
- Destructor
If the name of the class is "Yellow", what can be the possible name for its constructors?
- yellow
- YELLOW
- Yell
- Yellow