0
#include <iostream>
#include <cmath>
using namespace std;
double dist(int x1, int x2, int y1, int y2)
{
    double r1 , r2 , d ;
    r1 = sqrt((x1*x1) + (y1*y1));
    r2 = sqrt((x2*x2) + (y2*y2));
    d = sqrt((x2 - x1)*(x2 - x1) + (y2 - y1)*(y2 - y1));
    cout << " Distance from first point to origin :" << r1 << endl;
    cout << " Distance from second point to origin :" << r2 << endl;
    cout << " Distance between the two points:" << d << endl;
    return r1,r2,d;
}
int main()
{
    int x1, x2, y1, y2;
    cout << " Enter values for x1 x2 y1 y2\n";
    cin >> x1 >> x2 >> y1 >> y2 >> "\n";
    dist(x1, x2, y1, y2);


    char aaaa;
    cin >> aaaa;

    return 0;
}
1
Contributor
1
Reply
13
Views
3 Years
Discussion Span
Last Post by daniela.valkanova
0

Error 1 error C2679: binary '>>' : no operator found which takes a right-hand operand of type 'const char [2]' (or there is no acceptable conversion)

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.