AMCAT Pseudocodes Quiz-1

Question 1

Time: 00:00:00
What will be the output of the following code?
#include<bits/stdc++.h>
#include <iostream>
using namespace std;
int main() {
// Write C++ code her
string str = "prepinsta";
for(int i=0;i<str.size(); i+=2){
cout<<str[i++];
}
return 0;
}

peisa

peisa

pps

pps

ppa

ppa

piepa

piepa

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?
int main()
{
char a[] = "Prepinsta";
printf("%.*s",5,a);
return 0;
}

Prepi

Prepi

Insta

Insta

insta  

insta  

Compilation error

Compilation error

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 program?
#include <iostream>
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 4

Time: 00:00:00
What is the output of below program?
int main()
{
if(0)
{
cout<<"Hello";
}
else
{
cout<<"Prepinsta";
}
return 0;
}

Hello  

Hello  

HelloPrepinsta

HelloPrepinsta

Prepinsta

Prepinsta

PrepinstaHello

PrepinstaHello

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 <iostream>
using namespace std;
int main() {
int a=10;
cout<<(++a)--<<" "<<a;
return 0;
}

9 11  

9 11  

11 12

11 12

11 10

11 10

10 12

10 12

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

Please login to submit your explanation

Start

Question 6

Time: 00:00:00
Choose the correct option by analyzing the given code
#include<stdio.h>
int x = 0;
int main(){
if(x == x)
{
printf("Delhi");
}
else
{
printf("Noida");

}
return 0;
}

else

else

Delhi

Delhi

Ifelse

Ifelse

Noida

Noida

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 value of b of following code?
#include <iostream>
using namespace std;
int main() {
// Write C++ code here
int a=20, b= a+(a)++ + (++a);
cout<<(b++);
}

63

63

64

64

60

60

61

61

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 pseudo code ?
#include<stdio.h>
void count(int n)
{
static int d=1;
printf("%d ",n);
printf("%d ",d);
d++;
if(n>1)
count(n-1);
printf("%d ",d);
}
void main()
{
count(3);
}

3 1 2 1 1 1 2  

3 1 2 1 1 1 2  

3 1 2 2 1 3 4 4 4  

3 1 2 2 1 3 4 4 4  

3 1 2 2 3 4  

3 1 2 2 3 4  

3 1 3 3 1 3 4 4 2

3 1 3 3 1 3 4 4 2

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<stdio.h>
int main()
{
for (int i = 10; i >= 0; i--) {
int k = i & (i >> 1);
if (k)
printf("%d ", i);
}

}

8 8 9

8 8 9

7 6 3

7 6 3

11 7 6 3

11 7 6 3

0 7 6 3

0 7 6 3

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?
int main()
{
char a[] = "Prepinsta";
printf("%.*s",5,a);
return 0;
}

Prepi

Prepi

Insta

Insta

insta

insta

Compilation error

Compilation 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

Prime Video

Complete video course for AMCAT Sample Paper

For AMCAT
Prime Video

Prime

Prime Mock

Topic-wise full mocks based on AMCAT Sample Paper

For AMCAT
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

Comments