Advertisement
Guest User

ninth.cpp

a guest
Aug 27th, 2014
258
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.67 KB | None | 0 0
  1. #include <fstream>
  2. #include <iostream>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     ifstream inFile;
  8.     ofstream outFile;
  9.     inFile.open("inData.txt");
  10.     outFile.open("outData.txt");
  11.     int n1, n2, n3, n4;
  12.     char ch;
  13.     inFile >> n1;
  14.     inFile >> n2;
  15.     inFile >> ch;
  16.     inFile >> n3;
  17.     inFile >> n4;
  18.     outFile << "The Sum of " << n1 << " and " << n2 << " = " << n1 + n2 << endl;
  19.     outFile << "The character that comes after " << ch;
  20.     outFile.flush();
  21.     outFile << " in the ASCII set is " << ++ch << endl;
  22.     outFile << "The product of " << n3 << " and " << n4 << " = " << n3 * n4 << endl;
  23.     inFile.close();
  24.     outFile.close();
  25.     return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement