How to reverse a string using a recursive function, without
swapping or using an extra memory?
Answers were Sorted based on User's Feedback
Answer / mahendra aseri
Using recursive Function:
void rev_str(char *str)
{
if(*str!=NULL)
rev_str(str+1);
printf("%c",str);
}
| Is This Answer Correct ? | 20 Yes | 43 No |
what is the difference between. system call and library function?
What is main function in c?
#include<stdio.h> main() { char s1[]="Ramco"; char s2[]="Systems"; s1=s2; printf("%s",s1); } what will happen if you executed this code?
Is the below things valid & where it will be stored in memory layout ? static const volatile int i; register struct { } ; static register;
typedef struct{ char *; nodeptr next; } * nodeptr ; What does nodeptr stand for?
pgm to find middle element of linklist(in efficent manner)
Explain how can you tell whether two strings are the same?
What is difference between %d and %i in c?
What is the scope of an external variable in c?
what are the 10 different models of writing an addition program in C language?
A.C func() { pritnf(" in fuction %d",MACRO); } MAIN.c testfunc() { #define MACRO 10 printf("in test function %d", MACRO); } main() { printf("in main %d",MACRO); func(); testfunc(); getch(); }
What are dangling pointers? How are dangling pointers different from memory leaks?