Decrypt file

    0

    0

    Giovanny Gongora

    Codiga's C Recipes
    #include<stdio.h>
    #include<conio.h>
    
    int main(){
      char fname[20], ch;
      FILE *fps, *fpt;
      printf("Enter Filename: ");
      gets(fname);
      fps = fopen(fname, "w");
      if(fps == NULL)
        return 0;
      fpt = fopen("temp.txt", "r");
      if(fpt == NULL)
        return 0;
      ch = fgetc(fpt);
      while(ch != EOF){
        ch = ch-100;
        fputc(ch, fps);
        ch = fgetc(fpt);
      }
      fclose(fps);
      fclose(fpt);
      printf("\nFile %s Decrypted Successfully!", fname);
      getch();
      return 0;
    }
    
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Explore
    • Cookbooks
    • Playground
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.