Question 1

Time: 00:00:00
Which of the following is an iteration statement?

Switch

Switch

If-else

If-else

If

If

Do-while

Do-while

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Question 2

Time: 00:00:00
In java, -----------can only test for equality, whereas ------------can evaluate any type of boolean expression

Switch, if

Switch, if

If, switch

If, switch

If, break

If, break

Continue, if

Continue, if

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Question 3

Time: 00:00:00
Which of the following is used with switch Statements

do

do

Break

Break

Exit

Exit

Continue

Continue

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Question 4

Time: 00:00:00
Which of the following is not a valid jump statement?

break

break

goto

goto

continue

continue

return

return

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Question 5

Time: 00:00:00
Which of the following is not a valid flow control statement?

exit()

exit()

break

break

continue

continue

return

return

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Question 6

Time: 00:00:00
Which one of the control structures is similar to the if-else statement?

Switch-Case

Switch-Case

For loop

For loop

While loop

While loop

Continue

Continue

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Question 7

Time: 00:00:00
What will be the output of the program?


int i = l, j = -1;
switch (i)
{
case 0, 1: j = 1; /* Line 4 */
case 2: j = 2;
default: j = 0;
}
System.out.println("j = " + j);


Compilation fails

Compilation fails

j=2

j=2

j=3

j=3

j=1

j=1

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Question 8

Time: 00:00:00
Which statement is used to skip for the current iteration and continue for the next statement?

Break

Break

Continue

Continue

Skip

Skip

None of the above

None of the above

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Question 9

Time: 00:00:00
What will be the output of the program?


int i = 1, j = 10;
do
{
if(i > j)
{
break;
}
j--;
} while (++i < 5);
System.out.println("i = " + i + " and j = " + j);

 i = 5 and j = 5

 i = 5 and j = 5

i = 6 and j = 5

i = 6 and j = 5

i = 5 and j =5

i = 5 and j =5

i = 5 and j = 6

i = 5 and j = 6

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Question 10

Time: 00:00:00
Which statement is used inside the switch to stop fall-through condition?

Continue

Continue

Break

Break

goto

goto

None of the above

None of the above

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

["0","40","60","80","100"]
["Need more practice!","Keep trying!","Not bad!","Good work!","Perfect!"]

Personalized Analytics only Availble for Logged in users

Analytics below shows your performance in various Mocks on PrepInsta

Your average Analytics for this Quiz

Rank

-

Percentile

0%

Get over 200+ Courses under One Subscription

mute

Don’t settle Learn from the Best with PrepInsta Prime Subscription

Learn from Top 1%

One Subscription, For Everything

The new cool way of learning and upskilling -

Limitless Learning

One Subscription access everything

Job Assistance

Get Access to PrepInsta Prime

Top Faculty

from FAANG/IITs/TOP MNC's

Get over 200+ course One Subscription

Courses like AI/ML, Cloud Computing, Ethical Hacking, C, C++, Java, Python, DSA (All Languages), Competitive Coding (All Languages), TCS, Infosys, Wipro, Amazon, DBMS, SQL and others.

Comments