Advertisement
sanpai

Take a charecters from file replace by next charecter

Aug 21st, 2012
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. #include<stdio.h>
  2. int main()
  3. {
  4. char ch;
  5. FILE *fs,*fd;
  6. fs=fopen("1.txt","r"); //File where input is present
  7. fd=fopen("cat2.txt","w");// file where we are writing the out put
  8.  
  9. while(ch!=EOF)
  10. {
  11. ch=fgetc(fs);
  12. if(ch>=97 && ch<=121)
  13. {
  14. ch++;
  15. fputc(ch,fd);
  16. }
  17. else if(ch==122)
  18. {
  19. ch='a';
  20. fputc(ch,fd);
  21. }
  22. }
  23. fclose(fs);
  24. fclose(fd);
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement