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 / cmp

#include <stdio.h>
void print(char *s,int size){
if(size<0)
printf(" ");
else

{
printf("%c",*(s+size-1));
print(s,size-1);
}
}

void main(){
char *s={"aliveli"};
int size=0,i=0;

while(*(s+i)!='\0'){
size++;
i++;
}
print(s,size);
}

Is This Answer Correct ?    6 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

process by which one bit patten in to another by bit wise operation is? (a) masking, (b) pruning, (c) biting, (d) chopping,

2368


Is swift based on c?

1062


I have written a pro*C program to fetch data from the cursor. where in i have used the concept of BULK FETCH.... each FETCH statement is taking lots of time to fetch specified number of rows at...

10156


Is there any data type in c with variable size?

1045


What is a void * in c?

1030


What is the benefit of using #define to declare a constant?

1056


What is LINKED LIST? How can you access the last element in a linked list?

1028


how many types of operators are include in c language a) 4 b) 6 c) 8 d) 12

1031


FORMATTED INPUT/OUTPUT functions are a) scanf() and printf() b) gets() and puts() c) getchar() and putchar() d) all the above

1071


How are strings stored in c?

984


In C, What is the #line used for?

2113


How can I prevent another program from modifying part of a file that I am modifying?

1016


how can i access hard disk address(physical address)? are we access hard disk by using far,near or huge pointer? if yes then please explain.....

1748


Are c and c++ the same?

1012


Is a house a shell structure?

1116