Quiz 1

Question 1

Time: 00:00:00
Which of the following is not an iterative statement in java?

 

for ()

for ()

while()

while()

iterative()

iterative()

do while()

do while()

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

Please login to submit your explanation

Start

Question 2

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

Start

Question 3

Time: 00:00:00
What will be the value of i and j after execution of the following program?

#include<stdio.h>
void main ()
{
int i, j;
for (int i = 0, j = 0; i < 10, j < 20; i++, j++)
printf ("%d % d ",i,j);
}

10 10

10 10

10 20

10 20

20 20

20 20

Error

Error

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

Please login to submit your explanation

Start

Question 4

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

#include<stdio.h>
void main()
{
int a=0;
if(a)
printf("Prepinsta");
printf("PrepinstaPrime");
}

Prepinsta

Prepinsta

PrepinstaPrime

PrepinstaPrime

Compile time error

Compile time error

None of these

None of these

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

Please login to submit your explanation

Start

Question 5

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

#include<stdio.h>
void main ()
{
int a = 1;
while (a < 5)
{
printf ("Prepinsta");
}
}

Print Prepinsta 1 time

Print Prepinsta 1 time

Print Prepinsta 4 times

Print Prepinsta 4 times

Print Prepinsta infinite times

Print Prepinsta infinite times

No output

No output

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

Please login to submit your explanation

Start

Question 6

Time: 00:00:00
If we want to execute loop body at least one then we have go for ?

do-while loop

do-while loop

while loop

while loop

for loop

for loop

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

Start

Question 7

Time: 00:00:00
Without curly braces how many statements we can take between do and while statements.

One

One

Two

Two

Zero

Zero

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

Start

Question 8

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

#include<stdio.h>
void main()
{
static int a;
while(a>b++);
printf("%d %d", a,b);
}

0 1

0 1

0 0

0 0

0 1

0 1

1 1

1 1

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

Please login to submit your explanation

Start

Question 9

Time: 00:00:00
How many loops are there in c ?

1

1

2

2

3

3

4

4

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

Please login to submit your explanation

Start

Question 10

Time: 00:00:00
Which can be used for decision making statements?

switch case

switch case

break

break

continue

continue

for

for

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

Please login to submit your explanation

Start

["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%

Completed

0/0

Accuracy

0%

Prime

PrepInsta Prime Video

Complete video course for Cognizant GenC Elevate

for Elevate
Get Prime Video