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

Write a program to swap two numbers without using third variable in c?

1132


What is an lvalue?

1065


What is the code for 3 questions and answer check in VisualBasic.Net?

2160


What is a static variable in c?

1129


Tell me what are bitwise shift operators?

1132


What is quick sort in c?

1091


What is new line escape sequence?

1355


In c programming language, how many parameters can be passed to a function ?

1114


What is unary operator?

1108


Is anything faster than c?

1015


Is Exception handling possible in c language?

2048


What is a pointer on a pointer in c programming language?

1141


What is meant by int main ()?

1211


How does free() know explain how much memory to release?

1055


How can I check whether a file exists? I want to warn the user if a requested input file is missing.

1150