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
process by which one bit patten in to another by bit wise operation is? (a) masking, (b) pruning, (c) biting, (d) chopping,
Is swift based on c?
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...
Is there any data type in c with variable size?
What is a void * in c?
What is the benefit of using #define to declare a constant?
What is LINKED LIST? How can you access the last element in a linked list?
how many types of operators are include in c language a) 4 b) 6 c) 8 d) 12
FORMATTED INPUT/OUTPUT functions are a) scanf() and printf() b) gets() and puts() c) getchar() and putchar() d) all the above
How are strings stored in c?
In C, What is the #line used for?
How can I prevent another program from modifying part of a file that I am modifying?
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.....
Are c and c++ the same?
Is a house a shell structure?