Question 1

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

int main()
{
   short int diff=1;
   switch(++diff-diff++){
       case 1:
       printf("one over subtraction");
       break;
       case 2:
       printf("two over subtraction");
       break;
       default:
       printf("None");
       break;
   }
   return 0;
}

two over subtraction

two over subtraction

one over subtraction

one over subtraction

None

None

No output

No output

Question 2

Time: 00:00:00
Write the output of the following code in box?

#include <iostream>

int main(void)
{
int stones=5,pebbles=1;
stones-=pebbles+=stones;
printf("%d",stones);
return 0;
}

5

5

1

1

-1

-1

7

7

Question 3

Time: 00:00:00

What will be the output of the following code



#include <iostream>
int main()
{
int x=5;
int y=5;
if(!(x|y))
printf("x=y");
else
printf("x!=y");
return 0;
}

Run time error

Run time error

Compile time error

Compile time error

x!=y

x!=y

x=y

x=y

Question 4

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

#include <stdio.h>
int main()
{
int cat;
for(cat=5;cat>=1;cat--);
printf("%d",cat);
   return 0;
}

0  

0  

5  

5  

54321  

54321  

543210

543210

Question 5

Time: 00:00:00
What is the output of below code?
#include <iostream>
using namespace std;
int main()
{
int i;
for(i=5;i<=10;i++){
printf("%d",i);
}
return 0;
}

56789

56789

567890

567890

5678910

5678910

Error

Error

Question 6

Time: 00:00:00
Wha is the output of below code?
#include <iostream>
using namespace std;
int main()
{
do{
do{
printf("A");
break;
}while(1);
printf("B");
}while(0);

return 0;
}

Print a infinitely

Print a infinitely

Print AB

Print AB

Print B infinitely

Print B infinitely

Print A infinitely

Print A infinitely

Question 7

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

Question 8

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

Question 9

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

Question 10

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

null
null

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.