How to reverse a string using a recursive function, without
swapping or using an extra memory?
Answer Posted / rahul kumar
/* Program to reverse any string input by the user without
using library function strlen( );*/
#include <stdio.h>
#include<conio.h>
void main()
{
char a[]={"sixaN: you are with us or against us"};
int i,len=0;
char *b;
clrscr();
b=a;
while(*b!='\0')
{
len++;
b++;
} //counting lenght of string
for(i=len;i>-1;i--)
printf("%c",a[i]); //printing charachters in reverse
getch();
Output :
su tsniaga ro su htiw era uoy :Naxis
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Difference between linking and loading?
What are keywords in c with examples?
What is a wrapper function in c?
Explain about C function prototype?
What is the difference between printf and scanf in c?
find the value of y y = 1.5x+3 for x<=2 y = 2x+5 for x>2
Write a function that will take in a phone number and output all possible alphabetical combinations
Why main function is special give two reasons?
What is atoi and atof in c?
Is a house a shell structure?
write a c program to find the largest and 2nd largest numbers from the given n numbers without using arrays
Why is event driven programming or procedural programming, better within specific scenario?
What is a example of a variable?
typedef struct{ char *; nodeptr next; } * nodeptr ; What does nodeptr stand for?
What are qualifiers?