when i compile this code i get "error: non-lvalue in assignment" why? Just so you know, this program soves for the missing parts of a triangle, los and loc are law of sines and law of cosines respectively. The errors are commented and are in the last appx 30 lines of code.
/* Note, a capital letter represents an angle measure and
the same letter lowercase represents the length of the side opposite to that angle */
#include <iostream>
#include <cmath>
#define pi 3.14159265358989
using namespace std;
double A = 0;
double a = 0;
double B = 0;
double b = 0;
double C = 0;
double c = 0;
int main()
{
cout << "Hello, This program will solve a triangle given certain information." << endl;
cout << "Note, It does not have to be a right triangle.";
system("pause");
system("cls");
cout << "Enter any information that you know (Angles in degrees) (If you dont, enter 0)" << endl;
void missang()
//Finds the missing angle if only 2 are entered
{
//Finds A
if (A == 0 && B != 0 && C != 0) // A==, not A=
{
A = 180 - C - B;
}
//Finds B
elseif (A != 0 && B == 0 && C !=0) //same for B
{
B = 180 - A - C;
}
//Finds C
elseif (A != 0 && B != 0 && C == 0) //and C
{
C = 180 - A - B;
}
}
A single equal to sign (=) is for definition, double (==) is for comparision.