Quiz – 1

Question 1

Time: 00:00:00
What will be the output of the following pseudocode for i=140?

integer fun(int i)
if((i%2)!=0)
return i;
else
return fun(fun(i=1));
End function fun()

1

1

2

2

3

3

Error

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

#include<stdio.h>
int main()
{
int x=2,y=0,z=3;
x>y ?( printf("%d", z)):( return z);
}

2

2

3

3

Error

Error

11

11

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 below code?

Integer a, b, c, d, e
Set a=50 , b=3, c=3 e=0
while(c>0)
d=a mod b
e= e + d + a
c= c - 1
End while
Print e

165

165

160

160

170

170

Error

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

for (i = 1; i <= 6; i++)
for (j = i; j < 6; j++)
Print blank space
for (k = 1; k < (i * 2); k++)
Print *
End for
Line break
End for

* *** ***** ****** *******

* *** ***** ****** *******

* ** *** ***** ******* *********

* ** *** ***** ******* *********

* *** ***** ******* ********* ***********

* *** ***** ******* ********* ***********

None

None

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 algorithm?

Start
Declare a=0, I and b
for I =0 to 4
Increment a by 1
if I = 3 then
print hello
get out of the loop
End if
End for
print a

Hello4

Hello4

Hello

Hello

Hello3

Hello3

Error

Error

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 below code?
#include<stdio.h>
int
f (int n)
{
static int a = 0;
if (n <= 0)
{
return 1;
}
if (n > 3)
{
a = n;
return f (n - 2) + 2;
}
return f (n - 1) + a;
}

int main ()
{
printf ("Result: %d", f (5));
return 0;
}

20

20

18

18

16

16

Error

Error

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 below code?

integer a
if((a mod 10) IS EQUAL TO 0)
a=a*2
else if((a mod 5 ) IS EQUAL TO 0)
a=a/5
else
a=a-1
end if


If we pass input as : a=25, a=16

5, 15

5, 15

15, 5

15, 5

25, 5

25, 5

Compiler Error

Compiler Error

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

Please login to submit your explanation

Start

Question 8

Time: 00:00:00

integer a,b;
Set a=2; b=50;
while(b>0)
a = b%2 + a;
if( a MOD 2 Is Equal To 0)
Printf a
else
Print b-1
b = b/5
a=a+1
End while

2 9 4

2 9 4

4 9 2

4 9 2

8 18 4

8 18 4

Error

Error

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

Please login to submit your explanation

Start

Question 9

Time: 00:00:00

Integer array1[10] = {2, 3, 56, 34}
Integer k, a, j, n
Set a = 3, n = 4
for(each k from 0 to n-1)
Set array1[n] = array1[0]
for(each j from 0 to n-1)
Set array1[j] = array1[j+1]
End for
End for
for(each k from 0 to n-1)
Print array1[k]
End for

2 3 56 34

2 3 56 34

12 13 56 34

12 13 56 34

3 4 12 13

3 4 12 13

None of the mentioned

None of the mentioned

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 pseudocode?

Integer x,y,z
Set x=3
Set y=90
while(y is greater than 0);
y=y/3
x=x+6
c=x+y
while(c is greater than 30):
if(c mod 3 is equals to 0):
Write x
else:
Write y
c=c/5
Write c

9 18 15

9 18 15

6 33 9

6 33 9

9 33 6

9 33 6

None of the mentioned

None of the mentioned

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%

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