0% found this document useful (0 votes)
20 views5 pages

Technical Question 7

These documents contain examples of pseudocode code snippets and questions about their output. Multiple code examples are provided testing if/else statements, for loops, operations on integers, and function calls. The questions test understanding of variable assignment, conditional logic, and order of operations in the pseudocode.

Uploaded by

Vinoth
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)
20 views5 pages

Technical Question 7

These documents contain examples of pseudocode code snippets and questions about their output. Multiple code examples are provided testing if/else statements, for loops, operations on integers, and function calls. The questions test understanding of variable assignment, conditional logic, and order of operations in the pseudocode.

Uploaded by

Vinoth
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/ 5

1. What will be the output of the following code?

Integer a,b,c

Set b=300,a=5,c=1

If(b>a)

b=a

else

a=b

end if

for(each b from 0 to 5)

a=a+1

end for

print a+c

A. 12

2. What will be the output of the following code?

Integer a,b,c

set b=5,a=2,c=2

if(b>a||a>c||c>b)

b=a

else

a=b

end if

print a+b+c

Ans:6

3.What will be the output of the following pseudocode?

Integer a,b,c
Set b=4,a=2,c=2

if(b>>a && a<<c && c<<b)

b=a

else

a=b

end if

print a+b+c

Ans: 6

4.What is the value for b=18

Integer calculate(Integer b)

if(b EQUALS 1)

return 0

else

return 5+calculate (b/2)

end function calculate

Ans :20

5.What will be the output of the following pseudocode?

VALIDATE_DATA

Number =90

if(Number >90 and Number <95) then

display “Data within the range”

else

display “Data not within the range”

end-if
A. Data within the range will get displayed

B. Data not within the range will get displayed

C. Nothing will be displayed

6.The Output of the following pseudocode is ?

Set a=6,b=3,c=2

if(b>a && a>c && c>b)

b=a+1

else

a=b+1

end if

print a+b+c

Ans : 9

7.Which of the following series will be printed by the given pseudocode?

Integer i,j,k,n

set j=1,k=1

for(each i from 1 to 5)

print k

j=j+1

k=k+j

end for

A. 1 3 6 10 15

B. 1 2 3 4 5

C. 4 6 8 10

D. 1 1 2 3 5

8. What will be the output of the following pseudocode if a=10 and b=6?
Integer func(Integer a, Integer b)

Integer temp

While(b)

temp =a MOD b

a=b

b=temp

End while

return a

End function func()

A.2

B.4

C.3

D.1

9. What would be the output of the following pseudocode?

Integer i,j,k

Set k=6

For (each i from 1 to 1)

For(each j from the value of i to 1)

print k+1

End for

End for

A. 2

B. 6

C. 7
D. 5

10. What will be the output of the following pseudocode?

Integer a,b,c

Set b=4,a=2,c=2

if(b>>a & a<<c & c<<b)

b=a

else

a=b

end if

print a+b+c

Ans: 10

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy