1
GATE CSE 2001
Subjective
+5
-0
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)?
GATE CSE Subjects
Software Engineering
Web Technologies
EXAM MAP
Medical
NEETAIIMS
Graduate Aptitude Test in Engineering
GATE CSEGATE ECEGATE EEGATE MEGATE CEGATE PIGATE IN
Civil Services
UPSC Civil Service
Defence
NDA
Staff Selection Commission
SSC CGL Tier I
CBSE
Class 12