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

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

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

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

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

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

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

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

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

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

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

×
30+ Companies are Hiring

Get Hiring Updates right in your inbox from PrepInsta