Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

v.

v,

0 1unct,onl0.10) = 5

Quest ion ·. We have a set of cont inuou s even num bers


. For a function to return the
sum of these numbers wh at is the optimal inpu t requ
ired

Q The total coun t of the numbers

Q A\\ the numbers

Q The start numb er

Q The start number and the total count of the


numb ers

Ques tion : We would like to return the first 1


O vowe ls appea ring in a sentence.
Whic h of the follow ing funct ions will give us
the outpu t

0 (a) For each chara cter in the senten ce, if


it is vowel then add to outpu t array. Re turn
the first 1 0 eleme nts of the outpu t array
·
O (b) For each chara cter in the senten ce, if it
is vowel then add to outp ut array Return
t he a rr ay whe n it s length is 1 0

Q Bot h (a) and (b) w ill give th e require d output

Q Both ( a) and (b) will n o t g ive th e req uired


outpu l

Ques tion : W e h av e a n arra y o f c o nt i nuou


s a nd un s o r ted numbe rs from LI r0 r we
don' t I- now n . Wh ic h o f th e f o ll o w in g w
ill g i ve us n

Q , l w l a ,;.;\ 1c•lo..: 1n ~,n l in th e u , ruy


• • L • /

Question ·.

fu nc ti on (i ,j )
{
Do while ( i < j)
{
'i ++ ·
j-- ;
'
if (i == j)
re tu rn i;
}
)

Which of th e f ol lo
wi ng' ,t s Fa ls ~? 11

0 fu nc tio n( 1, 8) = 5

0 fu nc tio n( 0, 8) = 4

0 fu nc tio n( 5,9 ) = fu nc tio


n( 6.B)
0 fun cti on (0 ,10 ) =5

Uu t=~ t io n We h dv e d se t o f t t >r
llm uv u :::; t: , ~·11 nu
":> Ul ll ol 1 1k - !:.ii::' nu 11 1b t: , rit, '-'' :-.. .. , , t,n .
1 ~ ,.., hJ l ,~ t h .. P J Ht
pt , n , al • p,. ,i,
1:.·~.._. ,., -i
Question:

;ti!
Whi,ch ,o f the foll awi ni• ,.,.
log ic
if (x > 19)
if (y '.> x)
Di ·s\p1a.ttJ iH .Y l"

.Q if (x > 10 AND y ;> '1 0) then·i

Q '

If (ic > 1 o OR y > x) then Display "y''


',Iii

O if (x ,,, 10 ANO >e > y) then Display "y"

Q if (x :> 1 O AND y > x) then Di splay "y"

You might also like