Sunday, February 25, 2018

C Recursive Program which outputs the line with the characters reversed.

Example:
INPUT
This is easy

OUTPUT
ysae si sihT

 #include<stdio.h>
void reverse()
{
int c = getchar();
  if (c != EOF) {
    reverse();
    putchar(c);
  }
}

int main()
{
 
  reverse();
  return 0;
}

Thanks
Happy Computing !

No comments:

Post a Comment

What are 'Piecewise Functions'?

 A single function that uses different equations depending on the input , like f(x) = x for x < 0 and f(x) = x^2 for x >0. Such func...