ISRO Scientist/Engineer CSE 2018Programming in C › Program Output and Loops
ISRO Scientist/Engineer CSE 2018 PYQ: A language with string manipulation facilities uses the following operations. head$(s)$- returns the first…
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:
- AabCorrect answer
- Bba
- Cac
- Daa
Answer
(A) ab
Approach
Apply the string operations step by step to s = "acbc". head returns the first character; tail removes the first character. Evaluate the innermost operation first, then work outward, and finally concatenate the two resulting characters.
Reviewed by ISRO IQ Editorial Team.