Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

I need a sort of an approximate strcmp routine?

1075


What is the difference between the expression “++a” and “a++”?

1270


What does %p mean?

1152


Where static variables are stored in c?

1165


What is modifier & how many types of modifiers available in c?

1070


A program is required to print your biographic information including: Names, gender, student Number, Cell Number, line of study and your residential address.

1764


What is structure in c definition?

1105


What is context in c?

975


When should the register modifier be used? Does it really help?

1002


What is size of union in c?

1079


Explain how can you avoid including a header more than once?

1145


Explain output of printf("Hello World"-'A'+'B'); ?

1556


what do you mean by inline function in C?

1098


What is #include stdlib h?

1145


What is the explanation for modular programming?

1267