Advertisement
Guest User

Untitled

a guest
Jun 12th, 2012
13
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.58 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. using namespace std;
  4. int first,second;
  5. int main () {
  6.     ofstream myfile;
  7.     cout << "Please enter the first number (lower) \n";
  8.     cin >> first;
  9.     cout << "Please enter the second number (higher) \n";
  10.     cin >> second;
  11.     cout << first;
  12.     myfile.open ("number.txt");
  13.     while (first < second) {
  14.         cout << first << " \n";
  15.         myfile << first << " \n";
  16.         first = first + 1;  }
  17.     cout << first << " \n";
  18.     myfile << first << " \n";
  19.     myfile.close();
  20.     cout << "\nOutputted the log to number.txt in the root with the exe \n";
  21.     system ("pause");
  22.     return 0;}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement