Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. #include<iostream>
  2. #include<fstream>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. int num1;
  8. int num2;
  9. int num3;
  10.  
  11. cout << "Enetr 3 values: " << endl;
  12. cin >> num1;
  13. cin >> num2;
  14. cin >> num3;
  15.  
  16. ifstream infile;
  17. infile.open("c:\\number.txt");
  18. infile >> num1;
  19. infile >> num2;
  20. infile >> num3;
  21. infile.close();
  22.  
  23. cout << "The data has been written to file." << endl;
  24. cout << endl;
  25. system("pause");
  26. return 0;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement