hi, i'm having trouble correcting the syntax errors in this program it should except input from the keyboard for the first and second equations:
for example,
3a+9b+10c-8d=6
9a-2b+3c-4d=4
and the sum and difference should be the output. i appreciate any feedback how to correct this program.
Code:
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
int i1,
i2,
sum,
difference;
cout<<"Input the top equations: ";
cin>>i1;
cout<<"Input the bottom equations: ";
cin>>i2;
sum=i1+i2;
difference=i1-i2;
cout<<endl;
cout<<"The sum of "<<i1<<" and "<<i2<<" is "<<sum<<endl;
cout<<"The difference of "<<i1<<" and "<<i2<<" is "<<difference<<endl;
return 0;
}
Code:
1>------ Rebuild All started: Project: complex, Configuration: Debug Win32 ------
1>Deleting intermediate and output files for project 'complex', configuration 'Debug|Win32'
1>Compiling...
1>complex.cpp
1>c:\users\martin\documents\visual studio 2008\projects\complex\complex\complex.cpp(30) : error C2059: syntax error : '}'
1>c:\users\martin\documents\visual studio 2008\projects\complex\complex\complex.cpp(30) : error C2143: syntax error : missing ';' before '}'
1>c:\users\martin\documents\visual studio 2008\projects\complex\complex\complex.cpp(30) : error C2059: syntax error : '}'
1>Build log was saved at "file://c:\Users\Martin\Documents\Visual Studio 2008\Projects\complex\complex\Debug\BuildLog.htm"
1>complex - 3 error(s), 0 warning(s)
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========