Please login

Prime

Prepinsta Prime

Video courses for company/skill based Preparation

(Check all courses)
Get Prime Video
Prime

Prepinsta Prime

Purchase mock tests for company/skill building

(Check all mocks)
Get Prime mock

Quiz-1a

Question 1

Time: 00:00:00
What will be the value of s if n=127?

Read n
i=0
s=0
n = 127
Function Sample(int n)
while(n > 0):
r = n % 10
p = 8 ^ i
s = s + p * r
i += 1
n = n / 10
return s:
End Function

27

27

187

187

87

87

120

120

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 value of s if N=20?

Read N
Function sample(N)
s = 0
f = 1
End Function= 1
i = 1
while i <= N:
f = f * i
s = s +(i / f)
i+=1
End while
return(s);

3.789456

3.789456

2.7182818284590455

2.7182818284590455

80.36741

80.36741

2.7182817284590455

2.7182817284590455

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 if limit = 6?

Read limit
n1 = 0
n2= 1
n3=1
count = 1
while count <= limit:
count=count+1
print(n3,end = "")
n3 = n1 + n2
n1 = n2
n2 = n3
End While

112358

112358

12358

12358

123581321

123581321

12358132

12358132

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

Please login to submit your explanation

112358

Start

Question 4

Time: 00:00:00
What will be the value of even_counter if number = 2630?

Read number
Function divisible(number)
even_counter = 0
num_remainder = number
while (num_remainder):
digit = num_remainder % 10
if digit != 0 and number % digit == 0:
even_counter+=1
End If
num_remainder = num_remainder // 10
End While
return even_counter

3

3

4

4

2

2

1

1

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 value of t if a = 56, b = 876?

Read a,b
Function mul(a, b)
t = 0
while (b != 0):
t = t + a
b=b-1
End While
return t
End Function

490563

490563

49056

49056

490561

490561

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 6

Time: 00:00:00
Find the error in Code to sort given array in ascending order:

Read size
Read a[1],a[2],…a[size]
i=0
While(i<size)
j=i+1
While(j<size):
If a[i] < a[j] then
t= a[i]
a[i] = a[j]
a[j] = t

End If
j=j+1
End While
i=i+1
End While
i=0
While (i<size)
print a[i]
i=i+1
End While

Line 4

Line 4

Line 6

Line 6

Line 7

Line 7

No error

No 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 is the time complexity of searching for an element in a circular linked list?

O(n)

O(n)

O(nlogn)

O(nlogn)

O(1)

O(1)

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 8

Time: 00:00:00
In the worst case, the number of comparisons needed to search a singly linked list of length n for a given element is

log 2 n

log 2 n

n⁄2

n⁄2

log 2 n – 1

log 2 n – 1

n

n

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?

#include <iostream> 
using namespace std;
int main()
{
int a = 32, *ptr = &a;
char ch = 'A', &cho = ch;
cho += a;
*ptr += ch;
cout << a << ", " << ch << endl;
return 0;
}

129, a

129, a

32, a

32, a

32, A

32, A

129, A

129, A

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

Please login to submit your explanation

Start

Question 10

Time: 00:00:00
How many times the following loop be executed?

{
    …
   ch = ‘b’;
   while(ch >= ‘a’ && ch <= ‘z’)
   ch++;
}

25

25

26

26

1

1

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!"]

Completed

0/0

Accuracy

0%

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%

Comments

4 comments on “Quiz-1a”


  • Sivaraj

    In the homepage of prime mock – Capgemini, it shows 0/100 completed in the first pseudocode mock. But I completed 10 questions in that. I wish to get the next 90 questions. Also, it doesnt get updated in the counter that I have completed 10 questions. It shows that I have not solved any questions (0/100). it is not sowing or giving me any button to go for next 90


    • HelpPrepInsta

      Hey Sivaraj, the (0/100) counter is not of questions, it is of percent, it denotes how much percent questions have you solved in that particular quiz