Capgemini Pseudocode Question Bank
Capgemini Pseudocode Question Bank
Q1. Suppose a queue is implemented using a linked list and its front node and rear node are tracked
by two reference variable. Which of these reference variables will change during an insertion into a
NONEMPTY queue?
A. Both will change B. Only the rear will change C. Only the front will change
Q2. what will be the probability of selecting a random node from a given singly linked list?
A. n B. n(n+2) C. n(n+1) D. n 2
Q4. The order of an internal node in B+ tree index is the maximum number of children it can have,
suppose that a child pointer takes 6 bytes, the search field value takes 14 bytes, and the block size is
512 bytes. What is the order of an internal node?
A. 26 B. 27 C. 24 D. 25
Q5. consider a list of 12 numbers: 44,33,11,55,77,90,40,60,99,22,88,66 If we try to sort the list using
quick sort by taking 44 as pivot element, then which of the following list will be obtained after the
fourth iteration?
A.22,33,11,40,44,90,77,60,99,55,88,66 B. 22,33,11,55,77,90,40,60,99,44,88,66
C. 22,33,11,77,44,40,90,60,99,55,88,66 D. 22,33,55,11,77,90,40,60,99,44,88,66
Q6. Records are randomly distributed by a hash function in a space that can hold N number of
records. The probability that the mth record is the first record to result in a collision is :
A. [(N-1)(N-2)…(N-(m-2))(m-1)]/Nm-1 B. [(N-1)(N-2)…(N-(m-1))(m-2)]/Nm
C. [(N-1)(N-2)…(N-(m-2))(m-1)]/N D. [(N-1)(N-2)…(N-(m-1))(m-2)]/Nm-1
Integer i, j, sum, n
Repeat for i = 1 to n
set sum=+(i*i)
End loop
Print sum
A. 204 B. 49 C. 8 D.64
Integer a = 1, b = 2
a =a+b+ i.
a=a+b
b=a–b
Print b
end for
A. 3 10 27 70 B. 3 10 27 71 C. 3 9 23 70 D. 3 7 10
Q10. What will be the output of the following pseudo-code if we call fun()and the value of n is 5?
fun(int n, int a)
if ( n == 0) return a
return fun ( n- 1, n * a)
fun1( int n)
return fun( n, 1)
A. 15 B. 120 C. 16 D.24
Integer a ,b
Set a = 10, b = 7
a =a+i+ b
while ( a > 6 )
a=a+b
b=b-1
a=a–1
end while
Print a
End for
Q12. What will be the output of the following pseudocode for the input x=22 and y=3?
Start
Declare x, y,m, n
Set m = x and n = y
if m greater than n
m=m–1
Otherwise
n=n-1
End if
End while
Print n
Set x =0 and y = 1
print x
x=x+y
y = x /y
A. 0 1 3 8 B. 0 1 2 4 C. 1 0 2 4 D. 0 1 2 3
int m = 3, n = 2, o = 4
n=n-1
o=o+m
print m, n, o
A. 3 2 4 B. 2 3 4 C. 2 1 6 D. 1 0 5
Q15. What will be the output of the following pseudocode for a given array a[5] = 3, 4, 6, 1, 2 and
pos=2?
[Note: n = the size of the array i.e. 5 and starting array index is 0)
Declare i, j, n, pos
n=n-1;
End
int i =5,j=7
if (i+j > 5)
j=i + 2
if ( j < 5 )
print i.
else
print j
Else
print i+1
A. 5 B. 7 C. 12 D. 6
2. if (a<I)
3. return;
4. else
5. print a
6. fun(a-2)
7. print a
8. return
1. int p = 2, q = 6, r = 9, i
2.
3. if(r>p+q)
4.
5. for(i= 1 to 3)
6.
7. p= p+q
8.
9. q=q+1
10.
12.
13. r= p-q
14.
A. 23 9 9 B. 32 10 22 C. 23 9 14 D. 15 8 7
Q19. What will be the output of the following pseudocode for input a = 8 and b = 9?
function(input a, input b)
if(a < b)
return function(b,a)
else if(b != 0)
else
return 0
A. 88 B. 56 C. 72 D. 65
Q 20. What will be the output of the following pseudocode for num=5456?
Start
set n=n/10
Set k=k+1
End While
len=k
Set k=0
Set temp=digit[k]
Set digit[k]=digit[k+1]
End for
End If
End For
Print num
Stop
int p = 4, q = 7, r = 10
p = q Mod r
q=q+p
r=r+q
Print p, q and r
A. 7 11 17 B. 1 4 21 C. 7 14 24 D. 4 11 17
Integer t, j, sum, n
Repeat for i = 1 to n
sum= sum + ( i * i)
End loop
Print sum
A. 64 B. 49 C. 8 D. 140
rem = n Mod 10
n = n / 10
End while
Print rev
Else
End If
result = num1
else
result = num3
result = num2
else
result = num3
Print result
Q25. what will be the output of the following code for the input a=5 and b=6?
function do Something(input a, input b)
{ if (b==1)
return 0;
else
A. 30 B. 25 C. 18 D. 125
Q26. If L is the left node, M is the root node and R is the right node of a binary tree then an L-M-R
traversal can be termed as :
Q28. If the address of A[1][1] are 1000 and 1010 respectively and each elements occupies 2 bytes
then an array has been stored in ________order
A. Matrix major B. Column major C. row major D. None of the mentioned options
Q 29. what will happen if there is no base criteria mentioned in a recursive program?
Q30. If a node having two children is deleted from a binary tree it is replaced by its ?
Integer n,rev,rem,orig
Set n=61206,rev=0;
Set orig=n
rem=n MOD 10
n=n/10
end while
print rev
else
print (orig-rev)/6
end if
Q 32. If the address of A[1][1]and A[2][1] are 1000 and 1010 respectively and each element occupies
2 bytes then the array has been stored in_______order.
A. matrix major B. None of the mentioned options C. Column major D. row major
Q 33. What will happen if there is no base criteria mentioned in a recursive program?
Q34. Identify the point that is NOT true with respect to a stack.
C. Stack is a dynamic set where elements are removed in the reverse order of the insertions
D. It is not possible to insert or remove elements anywhere else except top on the stack
1.integer i,j,sum,n
2.Set sum=0,n=7
4.sum=sum+(i * i)
5.End loop
6.print sum
Q36. What will be the output of the following pseudocode for a given array a[5]=3,4,6,1,2 and
pos=2?
1.declare I,j,n,pos
3. Set a[j]=a[j+1]
5.n=n-1;
7.End
A. 3 2 4 6 1 2 B. 3 4 1 2 C.3 6 1 2 D.3 4 2 1 2
1.int p=2,q=6,r=9,i
2.if(6 > p + q)
3.for(i=1 t0 3)
4.p=p+q
5.q=q+1
7.r=p-q
8.print p,q,and r
Q39. Identify the point that is NOT true with respect to a stack.
B. It is not possible to insert or remove elements anywhere else except the top of the stack
D. Stack is a dynamic set where elements are removed in the reverse order of their insertions
Q41. If a binary tree has 10 nodes then what is the height of the tree?
A. 9 B. 11 C. 12 D. 3
Q42. Maximum possible number of nodes in the binary tree at level 5 is:
A. 31 B. 16 C. 30 D. 28
Q43. Consider an unsorted array A[1…n] with n distinct values the following algorithm can be used
to search a given x in that array.
Assume that x is present in the array A, what will be the expected number of comparisons required
by the algorithm before it terminates?
A. n B. 2n C.n-1 D. n/2
Q44. What will be the output of the following pesudocode?
1.int a=1
3.print a++
A. 2 4 6 B. 1 3 5 C. 2 D. 2 4
1.int p=2,q=6,r=9,i
2.if(r>p+q)
3.for(i=1 to 3)
4.p=p+q
5.q=q+1
7.r=p-q
A. 32 10 22 B.23 9 9 C.15 8 7 D. 23 9 14
Q46. What will be the probability of selecting a random node from a given singly linked list
Q47. Which of the following statements is true regarding linked list implementation of a stack?
B. In a push operation if new nodes are inserted at the end, then in pop operation nodes must be
removed from the beginning
C. In a push operation ,if new nodes are inserted at the beginning of a linked list then in operation
,nodes must be removed from at the end
Q48. Find out the number of inter change needed to convert the given array into max-heap.
89,19,50,17,12,15,2,5,7,11,6,,9,100
A .5 B. 3 C.2 D.4
Q49. What will be the output of the following pseudocode for x=11, y=5?
1. fun(int x,int y)
2.if(x==0)
3.return y
4.else
5.return fun(x-1,x-y)
3.for(i=1;i<=4;i=i+1)
4.print x
5.x=x+y
6.y=x/y
A. 0 1 3 8 B. 1 0 2 4 C. 0 1 2 3 D. 0 1 2 4
Q 51. Which of the following graph analysis algorithms would be applied for finding shortest path in
a weighted graph. Weights and can also be used for finding transitive closure of a relation R?
Q 52. What will be the output of the following pseudocode for the input n=6745?
1.Start
2.Read n
4.r=q mod 10
5.rn = rn * 10 +r;
6.q=q/10
8.Print rn
Q 53. What will be the output of the following pseudocode if we call fun1() and value of n is 5?
1.fun(int n, int a)
2.If(n == 0) return a
A. 120 B. 24 C. 16 D. 15
2.if(a>b)
4.print a
5. else
6. for( i= 1 to 3)
7. a =a + i
9.print a
10.else
11.print b
A. 14 B. 10 C. 16 D. 4
1. Integer i,j,sum,n
2.Set sum=0,n=7
5. sum=sum + j
6.End loop
7.End loop
8. Print sum
A. 147 B. 35 C. 56 D. 84
1.fun(int a)
2.if(a < 1 )
3.return
4. else
5. Print a
6. fun(a-1)
7.Print a
8.Return
A. 1 2 B. 2 1 C. 2 1 1 2 D. 3 2 1 1 2 3
Q 57. Which of the following data structure may give overflow error even through the current
number of elements in its less than its size?
A. 6 B. 5 C. 3 D. 4
1. Integer I,f,num
2. Set f=1,num=8
4. f=f*i
5. End loop
6. Print f
A. 0 B. 40320 C. 8 D. 1
1.Input a=6,b=9
2.Integer n
3.Set res=1
6. Else
8. Res = res*n
1. Int a=3,b=2
2. If(a+b<7)
3. a=a*0+b
4. Else
5. for( i= 1 to 4)
6. a = a+i
8. Print a,b+1
Q 62. The number of values that can be held by an array arr[-1….n,1…n] is:
A. n B. n2 C. n(n+1) D. n(n+2)
2.If(num1>num2)
3.If(num1>num3)
4.result=num1
5.Else
6.result=num3
7. Else if(num2>num3)
8.result =num2
9. Else
10.result=num3
11.Print result
Q 64. What will be the output of the following pseudocode for input 4?
2.{
4.return num+num*sum(num-1)
5.Else
6.return num
7. }
A. 26 B. 15 C. 44 D. 64
1.Integer a,b,c
2. Set a=10,b=20
3.for(c=a;c<=b;c=c+2)
4.a=a+c
5. b=b-a+c
7. Print a
8. Else
9. Print b
10. End if
A. 20 B. 20 32 C. 22 D. 20 23
1.Int a=15,b=45,c=9,i
2. If((c>(a+b))OR a <(5*c))
3. for (i= 1 to 3)
4. c = c*2
6. Else
7. While (a>b)
8. b= b+1
9. a = a-4
A. 45 72 B.41 4 C. 48 9 D. 45 9
Q 67. The minimum number for multiplications and additions required to evaluate the polynomial P-
4x3+3x2 -15x+45 is:
Q68. Consider the following pseudocode. How many multiplications are performed here?
1. M=2
2. for i=1 to N do
3. for j= i to N do
4.for k=j+1 to N do
5. M=M*3
6.End for
7.End for
8. End for
1.Integer a=1,b=2
2.for(int i=0;i<=6;i=i+2)
3.a=a+b+i
4.a=a+b
5.b= a-b
6.Print b
7.End for
A. 3 10 27 71 B. 3 10 27 70 C. 3 7 10 D. 3 9 23 70
Integer a , b
Set a = 2, b = 50
while( b>0);
a = b MOD 2 + a
Print (a);
else print(b-1)
Print b = b / 5;
a=a+1
end while;
A. 49 31 B. 50 102 C. 3 33 D. 50 32
Q 71. 4 Records are randomly distributed by a hash function in a space that can hold N number of
records. The probability that the mth record is the first record to result in a collision is :
Q 72. Four matrices Ay, Ay, Az and A, of dimensions a xb, bxc, cx d and dx e respectively can be
multiplied in several ways with the different number of total scalar multiplications. If a = 10, b = 100,
c = 20, d = 5 and e = 80, then at least how many scalar multiplications are required here?
Q73. Information about which of the following options is not present in the adjacency matrix
representation of a graph?
Q74. Which of the following data structure may give over flow error, even though the current
number of elements in it is less than its size?
A. None of the mentioned options B. Priority queue C. Simple queue D. Circular queue
1. int m = 3, n = 2, 0 = 4 ;
2.while (n > 0)
3. M = m*o+n;
4. n = n - 1 ;
6. O = 0 + M ;
7.print m, n, o;
A. 32 12 41 B. 3 2 4 C. 57 0 62 D. 2 1 6
Integer a,b;
while ( a > 0)
b = a + b;
a=a/5;
End ;
while
Print b;
else
a=a-b;
a = a / 2;
Print a ;
end if;
if( n EQUALS 4 )
return n;
else
A. 8 B. 2 C. 4 D. 16
4.if ( str[loop] == ch );
A. 03 B. 1 C. 0 D. 4
x = num = 1
y = x^ num
y=y+1
while ( y / 2 ) NOT EQUALS )
count = count + 1
else
y=y/2
if
Print "0";
Print y ;
else
Print "1"
Print x;
end if
Q 80. Let A, B, C, D, E be sorted sequences having lengths 20, 24, 30, 35, 50 respectively, they are to
be merged into a single sequence by merging together two sequences at a time. How many
comparisons are needed in the worst case by the optimal algorithm?
Q 81. If a node having two children is deleted from a binary tree, it is replaced by its:
Q 82. Consider a complete undirected graph with vertex set {0, 1, 2, 3, 4). Entry Win the matrix W
below is the weight of the edge {i, j}. What is the minimum possible weight of a spanning tree T in
this graph such that vertex O is a leaf node in the tree T? in this graph such that vertex O is a leaf
node in the tree T?
01814
1 0 12 4 9
W = 8 12 0 7 3
14702
49320
A. 8 B. 7 C. 9 D. 10
Q83. Consider the following fragment. Which of the following statements will be executed in this
case?
1. Integer x =10, y=3 and z=7 ;
2. if (x /y # )
3. if y> S1
4.else S2
5. else S3
set m = n ;
r = n mod 10
S = S* 10 + r;
n = n / 10;
print s ;
if(n is equal to m)
print m + 1
else
print m
for(i = 1 to 3)
C = C* 2
Else
while (a > 6)
b=b+1
a=a-4
end while loop
Print b, C
int i = 5,
j = 7 if (i + j > 5)
j=i+2
if (j<5)
print i
else
print j
else
print I + 1
A. 6 B. 7 C. 5 D. 12
Q 87. What will be the output of the following pseudocode for the input x=22 and y=3?
1. Start
2.. Declare x, y, m, n
3. Set m = x and n = y
5. if m greater than n
6.m = m - 1
7. otherwise
8.n = n - 1
9. End if
11. Print n
n=1
Set a1 = 2, b1 = 45 and c1 = 36
Set a2 = 11, b2 = 26 and c2 = 30
C = C1 + c2
b = c/ 60
C = C mod 60
b = b + b1 + b2
a = b / 60
b = b mod 60
a = a + a1 + a2
Print a:b:C
1. Integer a , b
2. Set a = 2, b = 50
3. while( b )
4. a = b MOD 2 + a
6.Print (a)
7.else
8.Print (b - 1)
A. 50 3 2 B. 49 3 1 C. 3 3 3 D. 50 10 2
Q 90. How many leaf nodes are present in a binary tree having a depth H?
A. 2 + 1 B. 2H C. 2H+1 + 1 D. 2H-1 – 1
1. Declare Integer c, d
5. if(array[d]>array[d+1])
6. r = array[d];
7.array[d] = array[d+1]
8. array[d+1]=r
9.end if
10.end for
11.end for
A. 67 45 23 13 12 B.12 13 23 45 67 C. 67 45 23 13 D. 45 67
if x=0 then
return (q,r)=(0,0)
else
set(q,r)=divide([x/2],y);
q=2*q,r=2 * r;
if x is odd then
r=r+1
end
if r > y then
r=r-y,q=q+1
end
return(q,r)
end
1. Int j= 41,k=37
2. j = j + 1
3. k= k-1
4. j=j/k
5. k=k/j
6. print k,j
A. 36 1 B. 1 1 C. 1 36 D. 42 36
1. Integer a=1,b=2
2. for(int i=0;i<=6;i=i+2)
3.a=a+b+i
4.a=a+b
5.b=a-b
6. Print b
7. End for
A. 3 10 27 71 B. 3 10 27 70 C. 3 7 10 D. 3 9 23 70
1. Integer a,b
2. Set a=125,b=122
4. While(a>0)
5.b=a+b
6.a=a/5
7.End while
8. Print b
9. Else
10.a=a-b
11.a=a/2
12. Print a
13. End if
A. 2 B. 234 C. 278 D. 27
Q 96. Consider the main function and fun1() implementations. What will be the output of the
following pseudocode?
1. Int a
2. Int main()
3.While(a)
4.fun1()
5. main()
6. Print flower
8. Print lily
1. Integer a,b
3. for(int i=1;i<=5;i++)
4. a=a+i+b
5. While(a>6)
6. a=a+b
7. b=b-1
8. a=a-1
9. End while
10. Print a
1. Integer i=0
2. i=i+12
3. print i
4. if(i<60)
6. Else
7. Print i+ 1
8. End if
Q100. Which of the following graph analysis would be applied for finding shortest paths it is a
weighted graph and can also be used for finding transitive closure of a relation R ?
Q101. What will be the output of the following pseudocode for input 7?
2. Set m=1,T=0
3. If m>N
4. Go to line no.9
5. Else
6. T=T+m
7. m=m+1
8. go to line no.3
10. Stop
A. 34 B. 72 C. 56 D. 28
1. Int p=4,q=7,r=10
2. p=q mod r
3. q=q+p
4. r=r+q
A. 7 11 17 B. 7 14 21 C. 7 14 24 D. 4 11 17
int a=9,b=7,c=8,d=4,e
e=a+b+c+d/4
if(e>5)
Print “PASS”
else print”FAIL”
A. Pass B. Fail C. 0 D. 1
Q104. What will be the output of the following pseudocode?
2. m = n/2
3. for (i = 2 to m)
4. if (n mod i = 0)
5. flag = 1
6. go to line number 9
7. end if
9. if (flag = 0)
10. print 0
A. 0 B. 1 C. 13 D.6
Q105. Which of the following is a type of sorting which relatively passes through a list to exchange
the first element with any element less than it and then repeats with a new first element ?
Q106. Information about which of the following options is not present in the adjacency matrix
representation of a graph?
fun(int a)
if(a < 1 )
return
else
Print a
fun(a-1)
Print a
Return
A. 1 1 B. 1 2 C. 2 1 1 2 D. 3 2 1 1 2 3
F1(n)=2n
F2(n)=n(3/2)
F3(n)=nlogn
F4(n)=n(logn)
Which among the following options correctly represents the increasing order of asymptotic
complexity of the functions F1,F2,F3,F4 respectively?
A. F3<F2<F4<F1
C. F3<F2<F1<F4
D. F2<F3<F1<F4
1. Int a=18,b=4,i
2. If(a>b)
3. If(a+b >14)
4.Print a
5.Else
6. for(i=1 to 3)
7. a=a+i
9. Print a
10.Print b
A. 4 B. 14 C. 16 D. 18 18 4
Q110. How much time will be required to generate all the connected components in an undirected
graph G with ‘n’ vertices and ‘e’ edges when the graph is represented by an adjacency list?
Q111. What will be the output of the following pseudocode for input 134?
2. 2. static int a = 0
3. 3. if ( num > 0)
4. 4. ara+1
5.5. fungnum/10)
6. 6. else
7. 7. return a
Note:[ Static variables have a property of preserving their value even after they are out of their
scope]
A. 3 B. 8 C. 431 D. 2
Q112. what will be the necessary condition to get the location of the desired element from a given
array using the following algorithm?
5. 2.1 MID=(LOW+HI)/2,
7. 2.3 LOC=MID
e b
g
Which of the following sequences are depth first traversals of the above graph?
1. a b e g h f
2. a b f e h g
3. a b f h g e
4. a f g h b e
A. only 1,2 and 4 B. only 2,3 and 4 C. only 1,3, and 4 D. only 1 and 4
1. Integer x,Y
2. Set x = 4, y=7
3. x = x + y
4. y = x - y
5. X = x + 4
6. Print x, y
1. Integer x=1, y
3. x = x + 1
4. end for
5. Print x
A. 6 B. 11 C. 10 D. 12
1. Integer x, y, z
3. z = (x + y) /0 // Line 3
5. Print successful
6. else
7. Print unsuccessful
1. Integer y , z , k , c
2. Set y = 8, z= 3, k= 1
3. if ( z + k < y )
5. c = y + z
6. else
7. c = y + k
8. y=y+z+k+e
9. else
10. y = y+c+k
11. end if
12. Print y
A. 21 B. 8 C. 23 D. 20
Q118. What will be the output of the following pseudocode if n = 40 and LIMIT = 1000?
1. Integer fun2(1nteger n)
2. if( n < = 0)
3. return 1
4. end if 4
5. if ( n > LIMIT)
6. return 2
7. end if
8. Print n
9. fun2(2 * n)
10. Print n
1. Integer i, j
6. end if
8. Print i
9. end if
[Note: ! Operater here basically inverts true to false and false to true]
A. 2 3 5 8 11 14 17 19 23 B. 1 3 7 11 13 17 19 23 25
C. 2 4 5 8 11 12 17 14 23 D. 2 3 5 7 11 13 17 19 23
Q120. Which of the following is the correct pseudocode for validating the entered date is correct or
not?
A.
4. 4. If (dd>81 and dd<=31) or (mm=: and mn81 and mm=c. and mm87 and mm=5 and mm=10 and
mm=12))
6. 6. Use If (dd>=1 and dd<=30) or (mm=4 and mm=o and mm=9 and mm=11))
10. 10. Else If(dd=29 and m=2 or (yy%400=0 and (yy%4=0 and yy%108:=0))
B.
4. 4. If (dd>=1 and dd<=31) and (mm=1 or mm=3 or mm=5 or mm=7 or mm=8 or m=10 or mm=12))
10. 10. Else If(dd=29 and mm=2 and (yy%400=0 or (yy%4=0 and yy%100!=0))
C.
13. End If
17. End If
Q121. An implementation of a queue 0, using two stacks S1 and S2, is given below:
1. void Insert(Q,x)
2. {
3. push(S1,x);
4. }
5. void delete(Q,x)
6. {
7. If(stack-empty(S2)) then
8. if(stack-empty(S1)) then
9. {
11. return;
12. }
16. push(S2,x);
17. }
18. x=pop(S2);
19. }
Let "n" insert and "m (5 n)^ delete operations to be performed in an arbitrary order on an empty
queue air. Let "x" and -r be the number of push and pop operations performed respectively in the
process. Which of the given options is I= for all on and n?
Q122. How many edges are present in a complete binary tree with 16 leaf nodes?
A. 14 B. 28 C. 32 D. 30
Q123. Consider following given algorithm and identify the task performed by this.
1. bstree(*tree)
2. {
4. {
6. bstree(tree->left);
7. else
8. return(!);
10. bstree(tree->right);
11. else
12. return(1);
13. }
14. return(0);
15. }
Q124. The running time T(n). where "n" is the input size of a recursive algorithm is given as
follows: T(n) = c + T(n-1), if n>1 T(n) = d, if n<1
A. n 3 B. n C. n n D. n2
Q125. Consider H as a hashing function which is used to hash n keys into a table of size m. where
n<rm , the expected number of collisions involving a particular key x is:
Q129. Which of the following would store the information of an array which is used in a program?
1. Integer a, b, c
2. Set a = 3, b = 5, c=1
3. a = a+b+c-8.
4. b = a+ c - 8
5. if ( a > b)
6. Print Fine
7. else
8. Print Thankyou
1. Integer x
2. Set x = 0
3. if(x IS EQUAL TO 1)
4.if(x IS EQUAL TO 3)
6. else
8. end if
9. else
11. end if
X=10,y=20,z=30;
1. if ( x > z)
2. if ( z < y)
3. Print A
4. else
5. Print B
6. end if
7. else
8. if (y > z )
9. Print C
10. else
11. Print D
12. end if
13. end if
1. Integer a, b, v, c
2. Set a = 5, b = 6,v=90
3. while(v > 8)
4. a = a + v
5. c = (a + b) mod 10
6. while(c > 9)
7. b = b - a
8. c = c – 1
9. end while
10. v = v / 2
12. Print b, c
A. 16 82 B. 150 12 C. 6 9 D. no output
1.Integer a,b,count=0,count1=0
2.Set a=1,b=1
3.while(a<=5)
4.b=1
5.while(b<=5)
6.b=b+1
7.count1 = count1 + 1
8.end while
9.a = a + 1
10.count = count + 1
A. 5 25 B. 24 5 C. 5 5 D. 25 5
Integer a, b, c, d, e
e = c mod a
a=a+b+e
d= c mod a
print d
A. 37 B. 14 C.12 D. 0