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
Why c is called a mid level programming language?
in iso what are the common technological language?
What are the standard predefined macros?
Write a C/C++ program to add a user to MySQL. The user should be permitted to only "INSERT" into the given database.
What are the key features in c programming language?
Array is an lvalue or not?
What are the 3 types of structures?
Can we initialize extern variable in c?
Write a program on swapping (100, 50)
With the help of using classes, write a program to add two numbers.
How can I invoke another program (a standalone executable, or an operating system command) from within a c program?
What is indirection? How many levels of pointers can you have?
Describe the steps to insert data into a singly linked list.
In C, What is the #line used for?
How does placing some code lines between the comment symbol help in debugging the code?