Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- using namespace std;
- int writeFile(int data)
- {
- ofstream myfile;
- myfile.open ("test2.txt");
- myfile << data;
- myfile.close();
- return 0;
- }
- int main()
- {
- int a;
- int b;
- int sum;
- cout<<"Podaj pierwszą liczbę:";
- cin >> a;
- cout<<"Podaj drugą liczbę:";
- cin >> b;
- sum = a+b;
- cout << sum;
- writeFile(sum);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement