MindTree Pseudo Code Quiz 1

Question 1

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

 

#include<stdio.h>

#include<iostream.h>

int main(){

register n = 25;

int far *x;

x=&n;

printf("%d ",*x);

return 0;

}

25

25

4

4

Address

Address

Compilation error

Compilation error

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

Please login to submit your explanation

Question 2

Time: 00:00:00
What will be the output of the following code statements?

 

integer a = 10,

b = 35, c = 5

print a * b / c - c

65

65

70

70

75

75

Compilation error

Compilation error

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

Please login to submit your explanation

Question 3

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

a=15;

b=0;

if(a=10)

Print b=7;

else b=1;

cout<< b;

1

1

6

6

7

7

10

10

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

Please login to submit your explanation

Question 4

Time: 00:00:00
Output of the following program will be?

#include<iostream.h>

Class Car

{

int x;

}

int main()

{

Car C;

cout < return0;

}

Runtime Error

Runtime Error

Compiler Error

Compiler Error

Garbage Value

Garbage Value

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

Please login to submit your explanation

Question 5

Time: 00:00:00
What is the output of this program?

class main_class {

public static void main(String args[])

{

if (i == 20) {

int j= 18;

System.out.println(i);

}

}

}

 

20

20

18

18

Compilation Error

Compilation Error

Runtime error

Runtime error

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

Please login to submit your explanation

Question 6

Time: 00:00:00
Find out the error, if any in the below program?

int j = 1;

switch(j)  {  printf("hello Prepster!");  case 1:

printf("case1");  break;

case 2: printf("case2");  break;  }

Case 1  

Case 1  

Case2

Case2

Both A & B

Both A & B

No error

No error

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

Please login to submit your explanation

Question 7

Time: 00:00:00
find the output of the following code

 

int main( )

{

int a=5, i, f1, f2, j;

if ( a < 2 )

return a;

else

{

f1 = f2 = 1;

for(i=2;i<n;i++)

{

j = f1 + f2;

f2 = f1;

f1 = j;

}

printf("%d",j) ;

}

}

5

5

6

6

7

7

8

8

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

Please login to submit your explanation

Question 8

Time: 00:00:00
If the value of a=5 and b=7 what will be the output of the following function?

int fun(int a, int b)

{

if(a<=0)

return b;

else

return(fun(a-1,b-1));

}

1

1

2

2

3

3

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

Please login to submit your explanation

Question 9

Time: 00:00:00
Choose the appropriate response after analysing the function given below.

 

 

public static void main(String[] args)

{

String names[] = new String[5];

for(int x=0; x<args.length; x++)

names[x] = args[x];

System.out.println(names[2]);

}

Null

Null

names

names

Compilation error

Compilation error

Runtime error

Runtime error

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

Please login to submit your explanation

Question 10

Time: 00:00:00
You must determine the proper output of the provided pseudocode, which is shown below.

 

 

int main()

{

float i = 0.0;

long int j = 10;

printf("%d", sizeof(i) == sizeof(i+j));

return 0;

}

1

1

2

2

4

4

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.

Comments