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
How can I get the current date or time of day in a c program?
What are the header files used in c language?
Which is the memory area not included in C program? give the reason
An application package has been provided to you without any documents for the following application. The application needs to be tested. How will you proceed?
how to print electricity bill according to following charges first 100 units -1rs per unit for next 200 units-1.50 rs per unit without using conditions
What are the types of macro formats?
How do you list a file’s date and time?
What is meant by initialization and how we initialize a variable?
What are the different types of control structures?
What is a list in c?
What is a pointer on a pointer in c programming language?
regarding pointers concept
Can we compile a program without main() function?
A global variable when referred to in another file is declared as this a) local variable b) external variable c) constant d) pointers
Is fortran still used in 2018?