Ask Question

Name:
Title:
Your Question:

Answer Question

Name:
Your Answer:
User Submitted Source Code!


Description:
  svv.c
Language: C/C++
Code:
#include<stdio.h>
#define MAX 100
char* getReverse(char[]);

int main(){

    char str[MAX],*rev;

    printf("Enter  any string: ");
    scanf("%s",str);

    rev = getReverse(str);

    printf("Reversed string is: %s",rev);
    return 0;
}

char* getReverse(char str[]){

    static int i=0;
    static char rev[MAX];

    if(*str){
         getReverse(str+1);
         rev[i++] = *str;
    }

    return rev;
}
          
          
Comments: