world=181
FUNCTION hello(int world)
INITIALIZE integer zero=0, integer remindme
WHILE world <>0
remindme=world%10;
zero=zero*10+remindme
hello(world/10)
ENDWHILEWRITE zero
ENDFUNCTION
A.zero
B.181
C.18
D.1
B
consider the following pseudocode: number=122,567,789,543,536,999
Sum:=0
Counter:=0
Average:=0
Input(number)
While number <>999
Sum=sum+number
Counter=counter+1
Input(number)
Endwhile
Average=sum/counter
Output(‘The average of the numbers is’,average:6:2)
A. 592.66
B. 511.40
C. 999.08
D. 3556.66
B
Set x to 1
Set y to 1
while(x<20)
write ‘x ‘
x=x+5
y=y+5
End while
A. 1 1 6 6 11 11 16 16
B. 1 5 10 15
C. 1 6 11 16
D. None of these
C
n1=9,n2=322,n3=798,n4=789,n5=987
READ n1,n2,n3,n4,n5
SET avg to (n1+n2+n3+n4+n5)/5
If(n1<n2)
SET max to n2
Else
SET max to n1
If(n3>max)
SET max to n3
If(n4>max)
SET max to n4
If(n5>max)
SET max to n5
Write max
If(n1>n2)
SET min to n2
Else
SET min to n1
If(n3<min)
SET min to n3
If(n4<min)
SET min to n4
If(n5<min)
SET min to n5
Write min
If(max<min)
Write max
Else
Write min
A.9 9 9
B.987 9 987
C.987 9 9
D.987 9 798
C
While<><>7
WRITE “HEY”
End While
A. HEY
B. HEYHEY
C. Infinite loop
D. None of these
C
READ integer i to 1
switch(i)
case i:
WRITE “case 1 executed”;
break
case i + 1;
WRITE“case 2 executed”;
break
case i + 2;
WRITE“case 3 executed”;
break
default:
WRITE“default block executed”;
break
A. case 1 executed
B. case 2 executed
C. case 3 executed
C. default block executed
E. Error : i is not usable
E
switch(3/3)
case 1:
WRITE“case 1 executed “
case 2:
WRITE“case 2 executed “
break;
case 3:
WRITE”case 3 executed “
break;
default:
WRITE“Default block executed”
A.Default block executed
B.case 1 executed
C.case 1 executed case 2 executed
D.Error:switch statements cannot hold
C
READ i equals to 25
if i is equals to 25
i = 50
if i is equals to 25
add 1 to i
if i is equals to 25
add 1 to i
else
add 1 to i
else
add 2 to i
else
add 2 to i
WRITE i
A.26
B.27
C.52
D.55
C
INITIALIZE false -1
INITIALIZE NULL 0
INITIALIZE true 1
if(NULL)
WRITE “NULL”
ELSEIF(false)
WRITE “TRUE”
ENDIF
ELSE
WRITE “FALSE”
ENDIF
A. TRUE
B. FALSE
C. NULL
D. Error
A
What will be the value of sum if num=187?
Read num
iter=0,sum=0
Function Star(int num)
while(num>0)
rem=num%l0
po=8^iter
sum=sum+po*rem
iter++
num=num/10
End While
Return sum;
End Function
A.187
B.87
C.135
D.71
C