This page explains solving line equation and print plotting points and it is very easy !

C++ Program:


using namespace std;

void main()
int a,b,c;
register int x,y;
cout<<"Enter the co-efficients of x,y & constant\n";
cout<<"your equation is "<<a<<" x "<<b<<" y "<<c<<" =0\n";
		cout<<"( "<<a<<" , "<<b<<" )  ";
		cout<<"( "<<a<<" , "<<b<<" )  ";
// This program can be used to plot points of line
// Enter 'zero' when co-efficient is zero

How it works? Edit

  1. Program enters the main()
  2. Variables a,b,c,x,y are declared
  3. Screen cleared
  4. Program asks you to enter details
  5. It shows entered value
  6. It enters for loop (1)
  7. There x value is initialized to -100 to start points from -100
  8. Then y value also done in same way
  9. The program checks whether it satisfies a*x+b*y+c=0 which is a basic line equation
  10. If it does it prints the value, otherwise it returns to for loop again
  11. In the same way,all value gets printed
  12. You may notice the presence of for loop again in (2),it is because at 1st, the program prints only y-major values.
  13. At (2) it prints x-major values
  14. Execution finished.

See also Edit

Ad blocker interference detected!

Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.