# Thread: Probably a pathetic lil error but i dont seem to find it |:<

1. ## Probably a pathetic lil error but i dont seem to find it |:<

sorry if this seems trivial, but ima beginner, its not really about the Text (its in German due to me studying there )
The "program" is should calculate the surface area, the extend and the diagonal line.
Somehow its not calculating my operations, and just outputs 0's
I dont quiet know what's wrong :|

Code:
```#include <stdio.h>
#include <math.h>

int main()

{

double h, b, diagonale, umfang, flaeche;
do
{
umfang = 0;
flaeche = 0;
diagonale = 0;

printf("\nGeben sie die Seitenlängen eines Rechtecks an (HxB)\n");
scanf("%lf %lf",&h, &b);

// Berechnung und Ausgabe der Diagonalen
sqrt(pow(h,2) + pow(b,2)) == diagonale;
printf("\nDie Diagonale des eingegebenen Rechtecks ist %lf\n", diagonale);

// Berechnung und Ausgabe von Umfang
printf("\nDer Umfang des eingegebenen Rechtecks ist %lf\n", 2*h+2*b=umfang);

// Berechnung und Ausgabe von der Fäche
h*b == flaeche;
printf("\nDie Fläche des eingegebenen Rechtecks ist %lf\n", flaeche);

}
while (h,b >= 0);

return 0;

}```
Thanks for reading and maybe helping me out!

2. One problem is on line 24: == is the comparison operator, but you should assign it to the var diagonale.
diagonale = sqrt(pow(h,2) + pow(b,2));

Same problem on line 31

How did you manage to compile this code ?
You should get an error msg like this:
main.c:28:72: error: lvalue required as left operand of assignment

3. this helped alot, still
"error: lvalue required as left operand of assignment
h*b=flaeche;"
^
when my code looks like this

Code:
```h*b=flaeche;
printf("\nDie Fläche des eingegebenen Rechtecks ist %lf\n",flaeche);```

4. (the ^ is below the "=" )

5. Imagine h == 2 and b == 3. Does 6 = flaeche make any sense?

Doesn't your textbook tell you how to assign values to a variable ?

6. Code:
```h*b=flaeche;
printf("\nDie Fläche des eingegebenen Rechtecks ist %lf\n",flaeche);

should be
flaeche = h*b;```