forked from Ashutoshak5384/html-basic-web-page
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdecryption.cpp
More file actions
33 lines (33 loc) · 696 Bytes
/
decryption.cpp
File metadata and controls
33 lines (33 loc) · 696 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include<iostream>
#include<fstream>
#include<stdio.h>
using namespace std;
int main()
{
char fileName[30], ch;
fstream fps, fpt;
cout<<"Enter the Name of File: ";
gets(fileName);
fps.open(fileName, fstream::out);
if(!fps)
{
cout<<"\nError Occurred while Opening the Source File!";
return 0;
}
fpt.open("tmp.txt", fstream::in);
if(!fpt)
{
cout<<"\nError Occurred while Opening/Creating tmp File!";
return 0;
}
while(fpt>>noskipws>>ch)
{
ch = ch-100;
fps<<ch;
}
fps.close();
fpt.close();
cout<<"\nFile '"<<fileName<<"' Decrypted Successfully!";
cout<<endl;
return 0;
}