write a C code
to reverse a string using a recursive function, without
swapping or using an extra memory.
Answer Posted / billy
string reverse with out recursion
void rev( char *p )
{
char tmp;
int len =strlen(p)-1;
for( int i=0 ; i <= len/2 ; i++ )
{
tmp = p[i] ;
p[i] = p[len - i ] ;
p[len - i ] = tmp ;
}
printf("%s",p);
}
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What is a rvalue?
Explain how are 16- and 32-bit numbers stored?
Why double pointer is used in c?
What is meant by type specifiers?
Why is c called a structured programming language?
Is c language still used?
I completed my B.tech (IT). Actually I want to develop virtual object that which will change software technology in the future. To develop virtual object what course I have to take. can I any professor to help me.
Write a function which takes as parameters one regular expression(only ? and * are the special characters) and a string and returns whether the string matched the regular expression.
Why main function is special give two reasons?
What are the 3 types of structures?
the question is that what you have been doing all these periods (one year gap)
What is a dynamic array in c?
What is data structure in c and its types?
What is the package for freshers(Non IIT) in amazon(hyderabad). And what is the same for those who are a contract employee.
Define C in your own Language.