1
GATE CSE 2001
Subjective
+5
-0
Consider the following C 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)?
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)?
Questions Asked from Pointer and Structure in C (Marks 5)
Number in Brackets after Paper Indicates No. of Questions
GATE CSE Subjects
Discrete Mathematics
Programming Languages
Theory of Computation
Operating Systems
Computer Organization
Database Management System
Data Structures
Computer Networks
Algorithms
Compiler Design
Software Engineering
Web Technologies
General Aptitude