0

Good day, I need help with my code. It's very simple and I was compiling it successfully at school, but at home I'm having problems with it.
Here is the code.
http://gyazo.com/dc78a310f529374338a244227b56215f

and

#include <cmath>
#include <iostream>
#include <conio.h>
using namespace std; 
int main ()
{
float a, b, c; 
cout « "Enter a" «endl; 
cin » a;
cout « "Enter b" «endl; 
cin » b; 
cout « "Enter c" «endl; 
cin » c; 
if (abs(a-c) == abs(a-b))
cout « "On the same length" « endl; 
else if (abs(a-b) < abs(a-c)) 
cout « "Point B is closer, AC = " « abs(a-c) « ", but AB = " « abs(a-b) « endl;
else if (abs(a-b) > abs(a-c))
cout « "Point C is closer, AB = " « abs(a-b) « ", but AC = " « abs(a-c) « endl; 
getch();
}
2
Contributors
1
Reply
8
Views
4 Years
Discussion Span
Last Post by Moschops
0

Spot the difference time:

« vs <<
» vs >>

The one on the left is not C++ code. The one on the right is. This is what happens when you copy and paste code.

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.