# Very newbie question about a program concerning cartesian plane and arrays

```#include <iostream> #include <cstdlib> using namespace std; //define type: struct TPont{double x,y;} ; //define the maximum relation: int max(int a,int b,int c,int d) { int max_val=a; if (b>max_val) max_val=b; if (c>max_val) max_val=c; if (d>max_val) max_val=d; return max_val; } int main() {     //input     TPont p;     int n;     //output     //checking the validity of input     bool hiba;     string tmp;     //intializing quadrants     int first=0;     int second=0;     int third=0;     int fourth=0;     //inputting     do{     cout << "How many points will you be checking for?" << endl; cin >> n;     error=cin.fail();         if (error)         {             cout << "Wrong input!" <<endl;             cin.clear(); getline(cin,tmp,'\n');         }     }while (error);     for(int i=0;i<n;i++){         do{         cout << "Please type the x and y coordinates of point p! " << endl; cin >> p.x >> p.y;         error=cin.fail();         if (error)         {             cout << "Wrong input!" <<endl;             cin.clear(); getline(cin,tmp,'\n');         }     }while (error);     //counting how many points lie in each quadrant     if (p.x>0)     {         if (p.y>0) first++;             else if (p.y<0) fourth++;     }else if (p.x<0){         if (p.y>0) second++;             else if (p.y<0) third++;     }     //If any points lie on the x axis then the program writes that     if (p.x==0)   {         cout << "The (" << p.x << ", "<< p.y <<")" << "point lies on the X axis." <<endl;     }     }     //checking for maximum and writing it on the screen     if (first==max(first, second, third, fourth))     {         cout << "Most points lie in the first quadrant." <<endl;     }     if (second==max(first, second, third, fourth))     {         cout << "Most points lie in the second quadrant." <<endl;     }     if (third==max(first, second, third, fourth))     {         cout << "Most points lie in the third quadrant." <<endl;     }     if (fourth==max(first, second, third, fourth))     {         cout << "Most points lie in the fourth quadrant." <<endl;     }     system("pause");     return 0; }```