0% found this document useful (0 votes)
68 views6 pages

Pseudocode Output and Concepts Quiz

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
68 views6 pages

Pseudocode Output and Concepts Quiz

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

What will be the output of the given pseudo code?

 Integer j
 Integer arr[2][2]= {{3, 1}, {1, 2}}
 arr[1][1]=(arr[0] [1]+arr[1] [0])+arr[0][0])
 if((arr[1][0]&arr[0] [0]&arr[1][0])<(4+arr[1][0]+2))

arr[1][0]=arr[1] [0]+arr[0][0]
 End if

arr[1][0]=(arr[1] [0]+arr[1][0])+arr[0][0]
 Print arr[1] [0]+arr[0] [0]

Note- &: bitwise AND – The bitwise AND operator (&) compares each bit of the first operand to the
corresponding bit of the second operand. If both bits are 1, the corresponding result bit is set to 1.
Otherwise, the corresponding result bit is set to 0.
Options
 3.0
 12.0
 8.0
 16.0

What will be the output of the given pseudo code?


 Integer a,b,c
 Set a = 8 b = 7 c = 9
 if( (3&a) < (c ^ 3) && 9<a)

b= (a + b) &c
 if((9 – b + c) > (c + a))
 c=a^a
 End if

End if
c=c+c
 Print a+b+c

Note- &&: Logical AND – The logical AND operator (&&) returns the Boolean value true (or 1) if both operands
are true and returns false (or 0) otherwise.
&: bitwise AND – The bitwise AND operator (&) compares each bit of the first 20 operand to the corresponding
bit of the second operand. If both bits are 1, the corresponding result bit is set to 1. Otherwise, the
corresponding result bit is set to 0.
Options
 30.0
 34.0
 33.0
 43.0

What will be the output of the given pseudo code?


 Integer a,b,c
 Set a = 5 b = 3 c = 6
b =(c&b)+b
 for(each c from 2 to 4)
b = (586) ^ a
 End for
 Print a + b

Note- & bitwise AND – The bitwise AND operator (&) compares each bit of the first operand to the
corresponding bit of the second operand. If both bits are 1, the corresponding result bit is set to 1. Otherwise,
the corresponding result bit is set to 0.

^is the bitwise exclusive OR operator that compares each bit of its first operand to the corresponding bit of its
second operand. If one bit is 0 and the other bit is 1, the Corresponding result bit is set to 1. Otherwise, the
corresponding result bit is set to 0.
Options
 24.0
 11.0
 -12.0
 6.0

What does the following pseudocode line represent?


While(temperature > 100)
Options

 Execute the loop while temperature is less than 100.

 Execute the loop while temperature is greater than 100.

 Execute the loop while temperature is equal to 100.

 Execute the loop once regardless of the temperature value

13)What is the term for a function that invokes itself?


 Self Function
 Auto Function
 Recursive Function
 Static Function

14)Which of the following is the default return value of functions in C++?


Options
 Char
 Int
 void
 Float

15)How should you position default parameters within a C++ function


prototype?
options
 To the rightmost side of the parameter list
 To the leftmost side of the parameter list
 Anywhere inside the parameter list
 Middle of the parameter list
16)How many times “A” will be printed in the following pseudocode?
 Integer a,b,c
 For(a = 0 to 4)
 For(b = 0 to 2)
 If(a is greater than b)
 Print “A”
 End for
 End for
 End If

Options
 8
 7
 9
 10

17)Which logical operator does not allow us to combine two or more


conditions?
Options
 AND
 OR
 NOT
 NAND

18)What is the term for a chart that illustrates the flow of functions or
processes without displaying any actual code?
 A fiowchart
 Structure chart
 Both A and B
 None

19)read the flowchart given below and answer the question that flows
If the fine paid for speeding was Rs 14000,which of the following could have been the speed?
Options
 128 km/hr
 136km/hr
 159 km/hr

170 km/hr

Question:
int array[] = {4, 5, 8, 9, 2);
int *ptr = (int*)(&array + 1);

What is the value of *(ptr - 1) ?

QUESTION 23 :
What is the output of the following code?

#include <stdio.h>
#include <stdint.h>
int main()
{
uint8_t a, max;

for(a=1; a<=255; a++) {


max = a;
}
printf(""max = %u"", max);
return 0;
}
A. None of the above
B. 256

C. 255

D. Infinite Loop

What will be the output of the following pseudocode?

1. Integer a,b,c
2. Set a = 6 b = 8 c = 10
3. For (each c from 2 to 4)
4. b = (2 + 5) + a
5. if ((8 + 3) < (6 + b))
6. b = b + b
7. a =10&&c
8.Else
9.jump out of the loop
10.End if
11. a = (B + 7) + c
12. End for
13. Print a + b
a. 88
b. 74
C. 59
D.69
QUESTION 26:
What will be the output of the given pseudo code for a=2 b=7, and c=6?
1.Integer funn (Integer a, Integer b, Integer c)
2 b=(c^8)+c
3 for(each c from 4 to 7)
4 b=(c+11)&b
5 a=11&a
6 End for
7 return a+b
Note- & bitwise AND- The bitwise AND operator (&) compares each bit of the first operand corresponding bit
of the second operand. If both bits are Otherwise, the corresponding result bit is set to 0. 1, the 188P
Corresponding result to the bit is set to 0.
is the bitwise exclusive OR operator that compares each bit of its second operand. If one bit is 0 and the other
bit is 1, the corresponding result bit is set to 1. Otherwise, the corresponding result bit is set to 0.

What will be the output of the given pseudo code?

1 Integer a,b,c
2 Set a=5, b=3, с=б
3.b-(c&b)+b
4.for(each c from 2 to 4)
5.b=(5&6)^a
6 End for
7.print a+b

Note- & bitwise AND-The bitwise AND operator compares each bit of the first operand to the corresponding
bit of the second operand .If both bits are 1,the corresponding result bit is set to 1. Otherwise, the
corresponding result bit is set to 0.
^ Is the bitwise exclusive OR operator that compares each bit of the first operand to the corresponding bit of
its second operand. If one bit is 0 and the other bit is 1, the corresponding result bit is set to 1.Otherwise, the
corresponding result bit is set to 1

Select the correct option from the given choices


a. 24.0

b. 11.0

c. -12.0

6.0

You might also like