rajeevs1992

Print a file with all words reversed

Dec 22nd, 2011
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.20 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<string.h>
  3. main()
  4. {
  5.     char string[10],i,*fp=fopen("file","r");
  6.     while(fscanf(fp,"%s",string)!=EOF && printf(" "))
  7.         for(i=strlen(string);i>=0;printf("%c",string[i--]));
  8. }
Advertisement
Add Comment
Please, Sign In to add comment