...
UGC NET CS 2014 June-paper-2
October 18, 2023
2014 June UGC NET Paper 1
October 18, 2023
UGC NET CS 2014 June-paper-2
October 18, 2023
2014 June UGC NET Paper 1
October 18, 2023

Programming

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)?

A
Theory Explanation is given below.
Correct Answer: A
0 0 votes
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x
error: Alert: Content selection is disabled!!