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

what are bit fields? What is the use of bit fields in a structure declaration?

2053


which of the following is not a character constant a) 'thank you' b) 'enter values of p, n ,r' c) '23.56E-o3' d) all of the above

2006


In a switch statement, what will happen if a break statement is omitted?

1008


What is the meaning of 2d in c?

1066


What is derived datatype in c?

1040


Why n++ execute faster than n+1 ?

2851


What is a macro?

1053


Write a programme using structure that create a record of students. The user allow to add a record and delete a record and also show the records in ascending order.

2044


What is pointer to pointer in c?

1064


What is the meaning of ?

991


Why are all header files not declared in every c program?

1045


How arrays can be passed to a user defined function

968


What are the types of variables in c?

980


What does nil mean in c?

1187


What is union in c?

1062