dimanche 17 septembre 2017

C# My code doesnt return string from if statement

if (ALength == 0 && BLength != 0 && CLength != 0 && ADegree == 0 && BDegree == 0)
        {

            GetSidesPythagoras();
            GetDegreeA();
            GetDegreeB();
            MessageBox.Show(ALength + " " + BLength + " " + CLength);
            RoundDoubleTo2Decimal();
            return $"a = √c^2-b^2 = {ALength}\n" +
                    $"b = {BLength}\n" +
                    $"c = {CLength}" +
                    $"A = cos-1(b/c) = {ADegree}\n" +
                    $"B = cos-1(a/c) = {BDegree}";





        }
        else
        {

            return "Error 304";
        }

I cant get my headaround why this wont work. the if satement is true, it runs whats inside of the if statement, but it doesnt return the string. It goes right to the else statement.

Shouldnt it return the string in the if statement? or am i missing something?

Aucun commentaire:

Enregistrer un commentaire