UGC NET CS 2014 June-paper-2
October 18, 20232014 June UGC NET Paper 1
October 18, 2023Programming
|
Question 84
|
Consider the following C program:
void abc(char*s)
{
if(s[0]==’\0’)return;
abc(s+1);
abc(s+1);
printf(“%c”,s[0]);
}
main()
{ abc(“123”)
}
(a) What will be the output of the program?
(b) If abc(s) is called with a null-terminated string s of length n characters (not
counting the null (‘\0’) character), how many characters will be printed by abc(s)?
|
Theory Explanation is given below.
|
Correct Answer: A
