All pastes #340452 Raw Edit

Miscellany

public text v1 · immutable
·published 2007-02-04 20:00 UTC
rendered paste body

#include <stdio.h>
#include <string.h>
 

char reverse(char *s, char *t);


int main()

{

     char source[25];

     char target[25];

    printf("Enter the source string\n");

     scanf("%s", &source);
 
     reverse(source, target);
 
     printf("The target string is %s", target);
     
     getch();
 
}
 
 
 
char reverse(char *s, char *t)

{
 
      int length=0;;
      length=strlen(s);
      
      while(length>=0);
      {
          *t=*(s+length);
          t++;
          length--;
      }
      *t='\0';
}