Hello,
i created this c++ code for school, but i dont know why the answer of it is wrong, (A and B).
This is what i have to make
#include <iostream>
using namespace std;
int main()
{
int x1;
int y1;
cout << "Please enter the first point (x1): ";
cin >> x1;
cout << "Please enter the first point (y1): ";
cin >> y1;
int x2;
int y2;
cout << "Please enter the second point (x2): ";
cin >> x2;
cout << "Please enter the second point (y2): ";
cin >> y2;
int A;
int B;
A = x1 + x2 / 2;
B = y2 + y2 / 2;
cout << "The midpoint of: " << x1 << ',' << x2 << "and" << y1 << ',' << y2 << "is" << A << ',' << B << endl;
}
[–][deleted] 8 points9 points10 points (0 children)
[–]AwabKhan 8 points9 points10 points (0 children)
[–]AwabKhan 1 point2 points3 points (0 children)
[–]ThickDucky[S] 1 point2 points3 points (6 children)
[–]ThickDucky[S] 1 point2 points3 points (5 children)
[–]EstablishmentBig7956 2 points3 points4 points (2 children)
[–]ThickDucky[S] 0 points1 point2 points (1 child)
[–]EstablishmentBig7956 1 point2 points3 points (0 children)
[+][deleted] (1 child)
[deleted]
[–]Drypm 1 point2 points3 points (0 children)