You are on page 1of 1

EXP7_4 #include<iostream.h> #include<conio.

h> int i=1; class linear { public: int var1,var2,v1,v2; linear() { v1=10; v2=10; } void accept() { cout<<"Enter the coefficient of x"; cin>>var1; cout<<"\nEnter the coefficient of y"; cin>>var2; } void d1() { cout<<"\n("<<i<<")z= "<<"("<<v1<<")x + ("<<v2<<")y"; } void find() { i=i+1; v1=v1+var1; v2=var2+v2; } }; void main() { clrscr(); linear l; cout<<"\nThe default equation is:\n"; l.d1(); cout<<"\nEnter the values for the new equation:\n"; l.accept(); l.find(); cout<<"The sum of both the equation is"; l.d1(); getch(); }

Page 1

Print to PDF without this message by purchasing novaPDF (http://www.novapdf.com/)