NTT Data Iteration, Recursion, Decision Quiz-1

Question 1

Time: 00:00:00
Which loop is especially useful when you process a menu selection?

while

while

do-while

do-while

for

for

switch

switch

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

Please login to submit your explanation

Start

Question 2

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

#include<stdio.h>

int main()

{

  int j=50;

  while(true)

  {

    if(j<10)

      break;

    j=j-10;

  }

  printf("j is %d", j);

}

Error

Error

No output

No output

j is 0

j is 0

j is 50

j is 50

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

Please login to submit your explanation

Start

Question 3

Time: 00:00:00
In the while and do-while loops, Which statement causes control to be transferred directly to the conditional expression that controls the loop?

break

break

pause

pause

start

start

continue

continue

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

Please login to submit your explanation

Start

Question 4

Time: 00:00:00
How many times below for loop will be executed ?

 

#include<stdio.h>

int main()

{

    int i=0;

    for(;;)

        printf("%d",i);

    return 0;

}

1 time

1 time

0 time

0 time

10 times

10 times

Infinite times

Infinite times

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

Please login to submit your explanation

Start

Question 5

Time: 00:00:00
Find the output of the following program.

#include<stdio.h>

int main()

{

    char str[] = "Smaller";

    int a = 100;

    printf(a > 10 ? "Greater" : "%s", str);

    return 0;

}

 

Compilation Error

Compilation Error

Greater  

Greater  

Smaller

Smaller

100

100

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

Please login to submit your explanation

Start

Question 6

Time: 00:00:00
Time Complexity of this program:

def f():

       ans = 0

       for i = 1 to n:

              for j = 1 to log(i):

                      ans += 1

      print(ans)

O(n)  

O(n)  

O(nlogn)  

O(nlogn)  

O(n2)  

O(n2)  

O(n3)

O(n3)

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

Please login to submit your explanation

Start

Question 7

Time: 00:00:00
 How many times will this loop execute?

#include<stdio.h>

int main()

{

int i;

for(i=0;i<10;i++)

{

printf("%d\n",i++);

i=++i;

}

return 0;

}

10

10

5

5

4  

4  

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
How many times will this loop execute?

#include<stdio.h>

int main()

{

int i=1;

for(;i<10;i=i/i)

{

printf("%d\n",i);

}

return 0;

}

10

10

5    

5    

4  

4  

Infinite times

Infinite times

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 times will this loop execute?

#include<stdio.h>

int main()

{

int max = 5;

int i = 0;

for(;;)

{

i++;

if(i> max)

break;

printf("i = %d\n",i);

}

return 0;

}

2

2

5  

5  

4  

4  

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 10

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

#include<stdio.h>

int main()

{

int max = 5;

int c = 0;

for(; c <max;c++);

{

         printf("%d ",c);

}

printf("END\n");

return 0;

}

0 1 2 3 4 End

0 1 2 3 4 End

1 2 3 4 5 End

1 2 3 4 5 End

5 End  

5 End  

Error  

Error  

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/10

Accuracy

0%

Prime Video

PrepInsta Prime Video

Complete Video Course for NTT Data

For NTT Data
Get Prime Video

Prime Mock

PrepInsta Prime Mock

Topic Wise Full Mock and much more

For NTT Data
Get Prime Mock
Get Prepinsta Prime

Get all 200+ courses offered by Prepinsta

Never Miss an OffCampus Update

Get OffCampus Updates on Social Media from PrepInsta

Follow us on our Media Handles, we post out OffCampus drives on our Instagram, Telegram, Discord, Whatsdapp etc.

Get Hiring Updates
Amazon,Google,Delottie & 30+companies are hiring ! Get hiring Updates right in your inbox from PrepInsta

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.

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.

Get PrepInsta Prime Subscription

Get access to all the courses that PrepInsta offers, check the out below -

Companies

TCS, Cognizant, Delloite, Infosys, Wipro, CoCubes, KPMG, Amazone, ZS Associates, Accenture, Congnizant & other 50+ companies

Programming

Data Structures, Top 500 Codes, C, C++, Java Python & other 10+ subjects

Skills

Full Stack Web Development, Data Science, Machine Learning, AWS Cloud, & other 10+ skills and 20+ projects