0% found this document useful (0 votes)
63 views

Pseudo Code

Uploaded by

Diptimayee Rana
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
63 views

Pseudo Code

Uploaded by

Diptimayee Rana
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 8

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

1. Integer a,b,c
2. Set a=4, b=6, c=9
3. If(a>b && (c^7)<7)
4. b=5+a
5. a=(3+9)+a
6. Else
7. B=(8^3)+b
8. End if
9. c=b+b
10. Print a+b+c
Options:
A. 57
B. 55
C. 50
D. 61

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


1. Integer p,q,r
2. Set p=9, q=3, r=8
3. If((q+r+p)<(r+p+q))
4. p=q+r
5. Else
6. r=(r+p)+r
7. End if
8. if((9+q)<p)
9. p=r+p
10. End if
11. Print p+q+r
Options:
A. 42
B. 32
C. 47
D. 37
3. What will be the output of the following pseudo code?
1. Integer p,q,r
2. Set p=5, q=2, r=6
3. If((p&q&r)<(3+r-p)
4. r=(7+11)&p
5. r=q+r
6. End if
7. q=11+q
8. Print p+q+r
Option:
A. 22
B. 17
C. 20
D. 26
4. What will be the output of the following pseudocode for a=3, b=4, c=9?
1. Integer funn(Integer a, Integer b, Integer c)
2. b=(c+3)+a
3. b=(c+c)+b
4. c=(c+5)+c
5. c=(c+5)+c
6. c=(a+3)+a
7. return a+b+c
Option:
A. 53
B. 46
C. 45
D. 42
5. What will be the output of the following pseudocode for a=7, b=2, c=8?
1. Integer funn(Integer a, Integer b, Integer c)
2. a=(b+a)^c
3. if((b&7)<a)
4. a=(6+8)+a
5. End if
6. Return a+b+c
Options:
A. 11
B. 17
C. 12
D. 10

7. What will be the output for the following pseudocode for a=5, b=7, c=9?
1. Integer funn(Integer a, Integer b, Integer c)
2. If((a+b)<c)
3. a=a+c
4. b=(c+a)+c
5. c=(9+9)+a
6. End if
7. Return a+b+c
Options:
A. 25
B. 21
C. 16
D. 26
8. What will be the output of the following pseudocode?
1. Integer a,b,c
2. Set a=5, b=4, c=4
3. If((c+a+b)<(b+c))
4. a=(b+a)+c
5. Else
6. b=(c+c)+b
7. End if
8. If((2+a)<(b+2))
9. b=(1+10)+c
10. End if
11. Print a+b+c
Options:
A. 25
B. 34
C. 24
D. 22

9. What will be the output of the following pseudo code?


1. Integer a,b,c
2. Set a=1, b=6, c=4
3. c=(a+b)&a
4. c=(c+c)+a
5. b=(9+8)+a
6. c=a&c
7. Print a+b+c
Options:
A. 20
B. 16
C. 22
D. 29

10. What will be the output of the following pseudocode for a=4, b=2, c=8?
1. Integer funn(Integer a, Integer b, Integer c)
2. b=b+a
3. if((b+c)<(a+b))
4. c=c+a
5. a=(10+12)&c
6. c=(5+11)+c
7. End if
8. Return a+b+c
Options:
A. 19
B. 12
C. 32
D. 18

11. What will be the output of the following pseudo code?


1. Integer a,b,c
2. Set a=4, b=6, c=9
3. if(a>b && (c^7)<7)
4. b=5+a
5. a=(3+9)+a
6. Else
7. b=(8^3)+b
8. End if
9. c=b+b
10. Print a+b+c
Options:
A. 50
B. 55
C. 61
D. 57

12. What will be the output of the following pseudo code?


1. Integer p,q,r
2. Set p=4, q=5, r=8
3. R=11&p
4. If(r<q || (p+q)>(q-p)
5. q=q+q
6. End if
7. if ((r+q-p)<(p-r))
8. p=p+p
9. End if
10. Print p+q+r
Options:
A. 19
B. 15
C. 12
D. 14

13. What is the output of the following pseudocode?


1. Integer funn(Integer a, Integer b, Integer c)
2. if((b+c+6)<(3+a+b))
3. b=(a+2)+b
4. End if
5. If((c&b)&(b+a)>(c&a))
6. c=(c+1)+b
7. End if
8. return a+b+c
Options:
A. 5
B. 9
C. 21
D. 11

14. What will be the output of the following pseudocode for a=9, b=8, c=4?
1. Integer funn(Integer a, Integer b, Integer c)
2. b=(b+8)+b
3. c=(9+2)+b
4. b=(b+b)+c
5. if(b>c && (9+4)<a)
6. c=b+c
7. End if
8. a=(5+7)+a
9. Return a+b+c
Options:
A. 135
B. 139
C. 142
D. 148

15. What will be the output of the following pseudocode for a=7, b=3, c=10?
1. Integer funn(Integer a, Integer b, Integer c)
2. a=(a+b)+c
3. c=a+a
4. b=(c+4)+c
5. c=(c+4)+c
6. c=(a&8)^b
7. c=(c+6)+c
8. return a+b+c
Options:
A. 279
B. 285
C. 278
D. 274

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


1. Integer a,b,c
2. Set a=1, b=4, c=4
3. c=(8+5)+c
4. b=(a+b)+b
5. b=a^c
6. b=c+c
7. Print a+b+c
Options:
A. 56
B. 52
C. 62
D. 21
17. What will be the output of the following pseudocode?
1. Integer a,b,c
2. Set a=5, b=4, c=4
3. if((c+a+b)<(b+c))
4. a=(b+a)+c
5. Else
6. b=(c+c)+b
7. End if
8. If(((2+a)<(b+2))
9. b=(1+10)+c
10. End if
11. Print a+b+c
Options:
A. 25
B. 22
C. 34
D. 24

18. What will be the output of the following pseudocode for a=7, b=8, c=9?
1. Integer funn (Integer a, Integer b, Integer c)
2. a=(b+12)&b
3. If((c+a)<(a-c))
4. c=a&c
5. b=10+b
6. c=(c+6)
7. End if
8. Return a+b+c
Options:
A. 23
B. 14
C. 17
D. 26

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


1. Integer p,q,r
2. Set p=9, q=4, r=8
3. if(6>q || 4>q)
4. r=8+p
5. Else
6. r=3+r
7. q=(9^6)+r
8. End if
9. p=9^r
10. Print p+q+r
Options:
A. ..
B. 45
C. ..
D. ..

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


1. Integer p,q,r
2. Set p=5, q=4, r=4
3. For (each r from 2 to 3)
4. p=(1+7)+q
5. p=12^r
6. End for
7. p=(r+2)^q
8. Print p+q
Options:
A. ..
B. ..
C. 5
D. ..

You might also like