1,924 views

A language with string manipulation facilities uses the following operations.

head$(s)$- returns the first character of the string $s$

tails$(s)$- returns all but the first character of the string $s$

concat$(s1, s2)$- concatenates string $s1$ with $s2.$

The output of concat(head$(s)$, head(tail(tail$(s)$))), where s is $acbc$ is:

1. ab
2. ba
3. ac
4. aa

### 1 comment

It should be a verbal ability question.

### Subscribe to GO Classes for GATE CSE 2022

s= acbc
concat(head(s),head(tail(tail(s))))
concat(head(s),head(tail(cbc)))
concat(head(s),head(bc))
concat(head(s),b)
concat(a,b)
ab
Option A is correct.

by
48 101 239

Tail(s)= there is ambiguity. If it is return all but from the first character of the string s. And according  to now which tail() explains in the question paper then more correct  answer should be D .

But answer A will be when tails() = return all but "not" Frist character of the string   then answer will be A
The statement i.e "tail(s)=return all but the first character in string (s)" has no negative sense.if  tail function returns every character of string then answer must be "aa" i.e D option otherwise question is wrong .
by
3 10 16

all but first -- what is the problem here?
if statement would be like" all but not first " or they should say "except" than surely it would be correct . If I am saying wrong please rectify me.
"all but" is a standard English usage, "not" is implied here.
Ok now I got it i.e Common sense  is applicable here. THANKS

1
6,043 views