InfyTQ Introduction To Programming Quiz 1

Question 1

Time: 00:00:00
Which of the following control  statements will be executed at least once even if the condition inside the loop is evaluated false?

while

while

for

for

do-while

do-while

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 2

Time: 00:00:00
Which of the following is the correct syntax for the “if” condition in Java?

  1. if (condition) :
{ //statements to be executed //if the condition is true. }

  1. if (condition) :
{ //statements to be executed //if the condition is true. }

  1. if (condition) ;
{ //statements to be executed //if the condition is true }

  1. if (condition) ;
{ //statements to be executed //if the condition is true }

  1. if (condition)
{ //statements to be executed //if the condition is true. }

  1. if (condition)
{ //statements to be executed //if the condition is true. }

  1. if (condition)
//statements to be executed  //if the condition is true.

  1. if (condition)
//statements to be executed  //if the condition is true.

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

Please login to submit your explanation

Question 3

Time: 00:00:00
Statements that determine which statement to execute and when, are known as?

Break Statements

Break Statements

Decision making statements

Decision making statements

Iteration Statements

Iteration Statements

Jump Statements

Jump Statements

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 control statements tests for equality?

Switch

Switch

while

while

do-while

do-while

if

if

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 control statements enhances the readability of the program?

while

while

if

if

if-else

if-else

switch

switch

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

Please login to submit your explanation

Question 6

Time: 00:00:00
In which of the following loops the user does not need to increment the value of the iterator?

while

while

do-while

do-while

for-each

for-each

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 7

Time: 00:00:00
The statements in java which are used to jump from one statement to another thus transferring the flow of execution are?

Decision-making statements

Decision-making statements

Jump statements

Jump statements

Branching Statements

Branching Statements

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 8

Time: 00:00:00
The statement which is used to terminate the loop and stop the current flow of the program are?

Jump

Jump

Continue

Continue

Switch

Switch

Break

Break

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

Please login to submit your explanation

Question 9

Time: 00:00:00
To skip the current iteration and jump to the next iteration of the loop, we make use of?

Switch

Switch

Continue

Continue

Break

Break

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 10

Time: 00:00:00
In switch statements the case expression can be of data type?

Int,string and enum type

Int,string and enum type

Any data type

Any data type

Float,double

Float,double

Boolean

Boolean

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.