Mega Code Archive

 
Categories / C / String
 

Print the string forward and backwards

#include <stdio.h> #include <string.h> char *p = "hello world"; int main(void) {   register int t;   printf(p);      for( t = strlen( p ) - 1; t > -1; t--)        printf("%c", p[ t ]);   return 0; }