Write a c++ program that adds 8 integers and send the result into a data file..
ID: 3634030 • Letter: W
Question
Write a c++ program that adds 8 integers and send the result into a data file..THis is what i did.. it has 12 errors idk how to fix them... please help!!
#include<iostream>
#include<fstream>
int main()
{
int total;
int a, b, c, d, e, f, g, h, i, j;
cout<< "Enter 10 integers: " << endl;
cin>> a >> b >> c >> d >> e >> f >> g >> h >> i >> j;
total= a+b+c+d+e+f+g+h+i+j;
ofstream fout;
stream object
fout.open("myoutput.txt");
fout<< total << endl;
fout.close();
}
Explanation / Answer
#include using namespace std; class foo { public: foo* returnme(void); }; foo* foo::returnme(void) { return this; } int main( int argc, char *argv[] ) { foo x; foo *y; y = x.returnme(); coutRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.