Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- using namespace std;
- int first,second;
- int main () {
- ofstream myfile;
- cout << "Please enter the first number (lower) \n";
- cin >> first;
- cout << "Please enter the second number (higher) \n";
- cin >> second;
- cout << first;
- myfile.open ("number.txt");
- while (first < second) {
- cout << first << " \n";
- myfile << first << " \n";
- first = first + 1; }
- cout << first << " \n";
- myfile << first << " \n";
- myfile.close();
- cout << "\nOutputted the log to number.txt in the root with the exe \n";
- system ("pause");
- return 0;}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement