How to reverse a string using a recursive function, without
swapping or using an extra memory?
Answers were Sorted based on User's Feedback
Answer / mahendra aseri
Using recursive Function:
void rev_str(char *str)
{
if(*str!=NULL)
rev_str(str+1);
printf("%c",str);
}
| Is This Answer Correct ? | 20 Yes | 43 No |
What is the difference b/w Structure & Class?
What is sizeof in c?
what is the difference between declaration ,defenetion and initialization of a variable?
What is the method to save data in stack data structure type?
What is the scope of static variables?
What is difference between the following 2 lines…. int temp = (int)(0x00); int temp = (0x00int);
Explain about C function prototype?
a simple c program using 'for' loop to display the output 5 4 3 2 1
Write a program for the following series: 1*3*5-2*4*6+3*5*7-4*6*8+.................up to nterms
What does the c preprocessor do?
Explain how can I prevent another program from modifying part of a file that I am modifying?
Given a piece of code int x[10]; int *ab; ab=x; To access the 6th element of the array which of the following is incorrect? (A) *(x+5) (B) x[5] (C) ab[5] (D) *(*ab+5} .