When i Run this program it gives me cannot execute this program this is the sour
ID: 3609510 • Letter: W
Question
When i Run this program it gives me cannot execute this programthis is the source code
#include<iostream.h>
#include<fstream.h>
void main()
{
int a,b,c,d;
char e;
ifstream infile;
ofstream outfile;
infile.open(indata.txt);
outfile.open(outdata.txt);
infile>>a>>b;
outfile<<"56+38 ="<<a+b;
infile>>e;
outfile<<"the charafter"<<e<<"is b";
infile>>c>>d;
outfile<<"7*8"<<c*d;
infile.close();
outfile.close();
}
Explanation / Answer
please rate - thanks I've highlighted all the changes I made to the program to get it torun. The ones in blue, I needed for the Cev C++ compiler. The ones inred are your corrections (files names have to be in quotes). Please be sure both files exist, before you the program #include #include int main() { int a,b,c,d; char e; ifstream infile; ofstream outfile; infile.open("indata.txt"); outfile.open("outdata.txt"); infile>>a>>b; outfileRelated 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.