HirePro Pseudocode Quiz 1

Question 1

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

#include
using namespace std;
int main()
{
int y=30;
while (y > 10)
{
y = y - 4;
}
cout<<y;

return 0;
}

10

10

8

8

20

20

Compiler error

Compiler error

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
using namespace std;
int main()
{
int num = 20;
if(num > 5)
{
cout<< num -6;
}
else{
cout<<3*(num + 1);
}

return 0;
}

22

22

14

14

23

23

3

3

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?

#include
using namespace std;
int main()
{
int n = 50;
if(n == 4)
{
cout<< n-6;
}
else{
cout<<3*(n+1);
}

return 0;
}

63

63

128

128

23

23

153

153

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.
#include
using namespace std;
int main()
{
int x = 201, y=1001;
if(x > 100)
{
cout<< y-x;
}
else{
cout<<3*(x+1);
}

return 0;
}

204

204

345

345

1001

1001

1000

1000

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
#include
using namespace std;
int main()
{
int a=230, b= 130;
a=a+1;
b=b-1;
a=a/b;
b=b/a;
cout<<a<<" "<<b;
}

5 78

5 78

64 1

64 1

1 345

1 345

1 129

1 129

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?
#include
using namespace std;
int main()
{
int p =1,q=2,r=3;
*( ( p+1==1) ? &q : &p)= p? q : r;
printf("%d, %d, %d \n", p , q, r );
return 0;
}

1 2 3

1 2 3

2 2 3

2 2 3

0 2 2

0 2 2

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
What will be the output of the following code?
#include
using namespace std;
int main()
{
int a = 678, b=40;
float c;
c = a / b;
cout<<c;
return 0;
}

16

16

16.4

16.4

1.64

1.64

164

164

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?
#include
int main()
{
int x = 2;
(x & 1) ? printf(“true”) : printf(“false”);
return 0;
}

true

true

false

false

Error

Error

zero

zero

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
#include
using namespace std;
int main()
{
int a = 48, b = 6;
printf("a^b = %d", a^b);
return 0;
}

3

3

54

54

78

78

49

49

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
#include
int main()
{
int a = 48, b = 4;
printf("a|b = %d\n", a|b);
return 0;
}

52

52

89

89

43

43

16

16

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

PrepInsta Prime Mock

Topic Wise Full Mock and much more

For HirePro
Get Prime Mock

Prime

PrepInsta Prime Video

Complete video course for HirePro

For HirePro
Get Prime Video
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