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 |
can you change name of main()?how?
Write a c program for sum of first n terms of the series S = 1 - (1/3) + (1/5) -(1/7) + (1/9) ......
how to exchnage bits in a byte b7<-->b0 b6<-->b1 b5<-->b2 b4<-->b3 please mail me the code if any one know to rajeshmb4u@gmail.com
I have an array of 100 elements. Each element contains some text. i want to: append a star character to the end of every fifth element remove every second character from every tenth element, and… add a line feed (ascii 10) after the 30th character of every array element whose length is greater than 30 characters.
discuss the steps needed to get a program from source code to executable in a system?
what is the function of pragma directive in c?
What are the commands should be given before weiting C Program i.e, Cd.. like
4 Answers IBM, Infonet, Satyam, Tech Mahindra,
How can I read/write structures from/to data files?
Why c is called a middle level language?
Explain the priority queues?
What is zero based addressing?
main() { int *ptr=(int*)malloc(sizeof(int)); *ptr=4; printf("%d",(*ptr)+++*ptr++); }
5 Answers Vector, Vector Solutions,