Shife the commas should be semicolons b) c) there should be a semicolon at the e
ID: 3701709 • Letter: S
Question
Shife the commas should be semicolons b) c) there should be a semicolon at the end of the statement d) the variable must always be the letter i when using a for loop If there is more than one statement in the block of a for loop, which of the following must be placed at the beginning and the ending of the loop block? 8. a) parentheses () b) braces (0 c) brackets I d) arrows 9. When does the code block following whille(xc100) execute? a) b) c) d) When x is less than one hundred When x is greater than one hundred When x is equal to one hundred While it wishes 10. How many times is a do while loop guaranteed to loop? a) o b) Infinite c 1 d) Variable 11. Which loop is correct? al do /code)while (condition b) dolf/code)while (coedition) d do U/eode)while (condion: d) NoneExplanation / Answer
Ques 8 . Answer : (b) Braces {}
Multiple statements are placed under {} block.
e.g:
for( i = 0 ; i < 10 ; i++ )
{
statement1
statement2
}
Ques 9. Answer : (a) when x is less than 100
The structure of while loop is
while( condition )
{
}
As the condition is
x < 100
which means x is less than 100
Ques 10. Answer : (c) 1
A do - while loop is a type of loop which runs atleast one time.
If first execute once and then check for the condition and if that condition is true, then it further executes.
Ques 11. Answer : Answer : (d) None
we have put a comment // code which also ignores the }while(// condition) as // ignores the complete line. So, the only code visible to compiler is
do{
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.