I have an assignment to create a file with number 1-20, and another one with numbers 100-5 decreasing by 5. I've got those two down, but then I need to multiply both those files together one by one and have the answer output to another file. ie: 1*100= 100, 2*95= 190.
Can someone help me with this? I really can't figure it out. This is where I'm stuck:
#include <iostream>
#include <fstream>
using namespace std;
int main ()
{
ofstream file1;
ofstream file2;
ofstream outfile;
int a=1,b=100,c=0;
file1.open("C:\\temp\\file1.txt");{
while(a<=20){
file1 << a << " ";
a++;
}
}
file1.close();
file2.open("C:\\temp\\file2.txt");{
while(b>0){
file2 << b << " ";
b-=5;
}
}
file2.close();
outfile.open("C:\\temp\\Result.txt");{
outfile << c;
}
outfile.close();
system("pause");
return 0;
}