How to reverse a string using a recursive function, without
swapping or using an extra memory?
Answer Posted / sravani
#include<stdio.h>
void strrev(char *);
main()
{
char s1[10];
printf("enter the string:");
scanf("%s",s1);
strrev(s1);
}
void strrev(char *p)
{
int i,j;
i=0,j=strlen(p)-1;
char temp;
while(i<j)
{
temp=p[i];
p[i]=p[j];
p[j]=temp;
i++;
j--;
strrev(s1);
}
| Is This Answer Correct ? | 5 Yes | 5 No |
Post New Answer View All Answers
a c variable cannot start with a) an alphabet b) a number c) a special symbol d) both b and c above
What is oops c?
How macro execution is faster than function ?
How can I call a function with an argument list built up at run time?
Do you know pointer in c?
What is a macro, and explain how do you use it?
Write a C/C++ program to add a user to MySQL. The user should be permitted to only "INSERT" into the given database.
Explain zero based addressing.
How would you rename a function in C?
Is there anything like an ifdef for typedefs?
process by which one bit patten in to another by bit wise operation is? (a) masking, (b) pruning, (c) biting, (d) chopping,
What is meant by realloc()?
What does int main () mean?
Where can I get an ansi-compatible lint?
An arrangement of information in memory in such a way that it can be easily accessed and processed by a programming language a) string b) data structure c) pointers d) array