Quick actions

cmd+k|ctrl+k

Navigation

Languages

lab3_163

Snippet info

Language

Cpp

Visibility

public

Author

matho.camara

Created

2018-10-24T10:33:51Z

Updated

2018-10-24T11:40:58Z

#include <iostream>
using namespace std;

int main() {
    int k,y,x,b,R;
    cout << "Input k,b and R values:"<<endl;
    cin>>k>>b>>R;
    
    //computing
   
    if(k!=0)
    {
        x=(R-b)/k;
        y=k*x+b;
       if(x>0 && y>0)
       cout<<"the intersection point is in the 1s quandrant"<<endl;
       else if(x>0 && y<0)
       cout<<"the intersection point is in the 4nd quandrant"<<endl;
       else if(x<0 && y>0)
       cout<<"the intersection point is in the 2rd quandrant"<<endl;
       else
       cout<<"the intersection point is in the 3th quandrant"<<endl;
    }else
    {
        y=b;
        if(y==R)
        cout<<"The line touch the circle."<<endl;
        else
        cout<<"there's no intersection point."<<endl;
    }
    
    return 0;
}
INFO