Home / MCQ Bank / Computer
Computer Miscellaneous On Data Structures Difficulty: Medium

How many times is the function recursive_reverse_string() called when the following code is executed? #include<stdio.h> #include<string.h> void recursive_reverse_string(char *s, int left, int right) { if(left < right) { char tmp = s[left]; s[left] = s[right]; s[right] = tmp; recursive_reverse_string(s, left+1, right-1); } } int main() { char s[100] = "madam"; int len = strlen(s); recursive_reverse_string(s,0,len-1); printf("%s",s); return 0; }

Select the correct option to test your answer:

More Computer Questions

Which of the following can be implemented using animation? How can Hadoop's audit logging be useful in a security context? How many digits are present after the decimal in float value? What is the name given to the 8-bit unit used for coding data? What will be the output of the following Java code? class Output { public static void main(String args[]) { double x = 3.14; int y = (int) Math.floor(x); System.out.print(y); } }