Advertisement
apl-mhd

convertFile

Nov 29th, 2016
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.51 KB | None | 0 0
  1. #include<stdio.h>
  2.  
  3. int main(){
  4.  
  5. int aa, b, sum;
  6. char ch , a;
  7. FILE *fInput;
  8. FILE *fOutput;
  9.  
  10. fInput = fopen("input.txt", "r");fputc(ch, fOutput);
  11. fOutput = fopen("output.txt","w");
  12.  
  13. //a = 'a' -32;
  14. //printf("%d\n", a);
  15.  
  16.  
  17.  
  18. while((ch = fgetc(fInput)) != EOF ){
  19.  
  20.         if(ch != ' '){
  21.  
  22.  
  23.         ch= ch - 32;
  24.         //printf(" %c",  ch );
  25.     fputc(ch, fOutput);
  26.         }
  27.         else
  28.             fputc(' ', fOutput);;
  29.  
  30.  
  31.  
  32.  
  33. }
  34.  
  35.  
  36.  
  37. fclose(fInput);
  38. fclose(fOutput);
  39.  
  40.  
  41.  
  42.  
  43. return 0;
  44.  
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement