1

Read file and add value

view story
linux-howto

http://www.unix.com – i have a file outfile.txt which contain 12 22 i have written this program to read the file and show the output,but i dont know how to add these value and show the total. my-codes are #include<cmath> #include<cstdlib> #include<iostream> #include<fstream> using namespace std; int main () { char filename [25]; ifstream myfile; cin.getline(filename,25); myfile.open(filename); if (!myfile.is_open()) { exit (0); } char number [25]; myfile >> number; while (myfile.good ()) { cout << number << " " << "\n&quot (HowTos)