TCS NQT Input/Output Quiz- 5

Question 1

Time: 00:00:00
What is the output of below code?

#include <iostream>
using namespace std;
int main()
{
int number=0141;
printf("%c",number);
return 0;
}

 

Compilation error

Compilation error

1100001

1100001

a

a

97

97

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 is the output of the following



#include <iostream>
using namespace std;
int main()
{
int m=10;
int n=m<<2;
printf("%d",n);
return 0;
}

16  

16  

40  

40  

10  

10  

20

20

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 output of the following code
Integer TruckTyres=8;
Integer trucktyres =6;
Display TruckTyres
Display trucktyres

8 8

8 8

8 6

8 6

6 6

6 6

Error both variable are same

Error both variable are same

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 code below
#include <iostream>
int main()
{
int digit=8 ;
printf("%d",digit<<1);
return 0;
}

8

8

-8

-8

16

16

-16

-16

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 code below 

#include <iostream>
int function1(int,int);
int main()
{
int a=10,b=10;
printf("%d",function1(a,b));
return 0;
}
int function1(int a , int b)
{
return(a-(a==b));
}

0

0

9

9

1

1

2

2

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

Please login to submit your explanation

Start

Question 6

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

#include<iostream>
using namespace std;
int main()
{
int a=5,b=0,c=15,d=20,e=0;
while(a<b)
e=(a+c)*d+c;
cout<<e<<""<<b;
return 0;
}

420 0

420 0

0 0

0 0

420 10

420 10

0 10

0 10

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

Please login to submit your explanation

Start

Question 7

Time: 00:00:00
What will be the output of the following code:
#include<iostream>
using namespace std;
int main()
{
   int num=5,i;
   long int result=1;
   for(i=num;i>(num-num);i--){
      result=result*i;
   }
   printf("%d",result);
   return 0;
}

60

60

120

120

Compile error

Compile error

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 code below
Integer x,y,z
Set z=6,y=8,x=9
if(z>x && y>z)
  z=x+y-1
Else
  x=y-z+9
End if
Print x+y+z

25

25

21

21

11

11

7

7

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

Please login to submit your explanation

Start

Question 9

Time: 00:00:00
What will be the output of the following code below
#include <iostream>
using namespace std;
int main()
{  char *p="1st code";
printf("%c\n",*&*p);
return 0;
}

b

b

1

1

-1

-1

a

a

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 of the following code below


#include
int func(int);
int main()
{
int i = func(100);
printf("%d" ,++i);
return 0;
}
int func (int i)
{
return i*i;
}

 

10002

10002

1001

1001

10001

10001

10000

10000

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%

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