fork download
  1. #include <iostream>
  2. #include <fstream>
  3. #include <random>
  4. #include <string>
  5.  
  6. using namespace std;
  7.  
  8. int main() {
  9. int x1 = 1;
  10. int y1 =1;
  11. int x2 =2;
  12. int y2 = 2;
  13.  
  14. int x = x2-x1;
  15. int y = y2-y1;
  16. int slope = y/x;
  17.  
  18. int ycept = y2-x2
  19.  
  20. cout <<" X2 - X1 = "<<(int)x2-x1<<endl;
  21. cout<<" Y2 - Y1 = "<<(int)y2-y1<<endl;
  22. cout<<" y / x = "<<y/x<<endl;
  23. cout <<"slope = "<<slope<<endl;
  24. cout<<"Y cept = "<<ycept<<endl;
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31. return 0;
  32. }
Compilation error #stdin compilation error #stdout 0s 15240KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:20:1: error: expected ‘,’ or ‘;’ before ‘cout’
 cout <<" X2 - X1 = "<<(int)x2-x1<<endl;
 ^~~~
stdout
Standard output is empty