#include<stdio.h>
#include <conio.h>
char* reverse(char[]); //function declaration
int main()
{
char number[100],*rev;
printf("Enter any string/number: ");
scanf("%s",number);
rev = reverse(number);
printf("Reversed of given string/number is: %s",rev);
getch();
}
//function definition.
char* reverse(char number[])
{
static int i=0;
static char rev[100];
if(*number){
reverse(number+1);
rev[i++] = *number;
}
return rev;
}
#include <conio.h>
char* reverse(char[]); //function declaration
int main()
{
char number[100],*rev;
printf("Enter any string/number: ");
scanf("%s",number);
rev = reverse(number);
printf("Reversed of given string/number is: %s",rev);
getch();
}
//function definition.
char* reverse(char number[])
{
static int i=0;
static char rev[100];
if(*number){
reverse(number+1);
rev[i++] = *number;
}
return rev;
}