trying to printout the sum and difference

hi,i'm trying to get the sum and difference of two equations inputted by the keybroad in this program i appreciate suggestions how to correct the syntax errors to get the program to compile.
an example of equations:
3a+9b+10c-8d=6
9a-2b+3c-4d=4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#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;
}

1
2
3
4
5
6
7
8
9
1
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 ==========




Some lines of code must be missing. The error says that it is at line 30 but your code snippet has no line 30...

Is this the complex.cpp file?

And why did you open a new topic? Was your old one not good enough? http://www.cplusplus.com/forum/beginner/24015/
Topic archived. No new replies allowed.