If statements not working correctly in program to determine triangle typeCan I have someone verify my collections for the SCJP ExamDecoding colored image using ZXing library in Javahow to perform a functional test on a triangleWhat should I use for the while loop?why spill failure happens for Custom Data Type in HadoopIf Elif Else Chain To Classify Triangle (Python)Triangle Side & Angle Classification GeneratorA condition in a C program doesn't give the desired resultKeep getting this error message for my RockPaperScissor Program. How do I fix this error?Java Methods - Calling and Defining

Blocking people from taking pictures of me with smartphone

Is it possible to script what applications should open certain file extensions?

SQL Minimum Row count

Short story about a teenager who has his brain replaced with a microchip (Psychological Horror)

Word or idiom defining something barely functional

How do we avoid CI-driven development...?

Best gun to modify into a monsterhunter weapon?

sed delete all the words before a match

Ex-contractor published company source code and secrets online

Is it really ~648.69 km/s delta-v to "land" on the surface of the Sun?

Double blind peer review when paper cites author's GitHub repo for code

Dropdowns & Chevrons for Right to Left languages

Are there any financial disadvantages to living significantly "below your means"?

Plausibility of Ice Eaters in the Arctic

Generator for parity?

Is multiplication of real numbers uniquely defined as being distributive over addition?

Team goes to lunch frequently, I do intermittent fasting but still want to socialize

How to identify the wires on the dimmer to convert it to Conventional on/off switch

In a topological space if there exists a loop that cannot be contracted to a point does there exist a simple loop that cannot be contracted also?

Can an SPI slave start a transmission in full-duplex mode?

Can a PC attack themselves with an unarmed strike?

Dereferencing a pointer in a for loop initializer creates a seg fault

Non-OR journals which regularly publish OR research

What is the idiomatic way of saying “he is ticklish under armpits”?



If statements not working correctly in program to determine triangle type


Can I have someone verify my collections for the SCJP ExamDecoding colored image using ZXing library in Javahow to perform a functional test on a triangleWhat should I use for the while loop?why spill failure happens for Custom Data Type in HadoopIf Elif Else Chain To Classify Triangle (Python)Triangle Side & Angle Classification GeneratorA condition in a C program doesn't give the desired resultKeep getting this error message for my RockPaperScissor Program. How do I fix this error?Java Methods - Calling and Defining






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








1















I have an assignment to write a program that uses the method triangleType that i must write to take three int inputs from the user and output the triangle type. In the method, I first need to sort the integers in ascending order so that the comparisons I am required to use will work correctly. I know I did the sorting part in the code correctly, because I tested it before I even started trying to determine the triangle type. I am required to use these comparisons to find the triangle type: "if A + B <= C, then the sides do not represent a valid triangle. if A = C (all the sides must be the same length) then the triangle is EQUILATERAL. if A = B or B = C, then the triangle is ISOSCELES; otherwise the triangle is SCALENE"
For some reasons my if statements at the end of the triangleType method are not working correctly and I get all sorts of output, including "Invalid Triangle" plus other outputs no matter the integers that I enter.



package trianglemethod;

import javax.swing.JOptionPane;


public class TriangleMethod



public static void main(String[] args)

String wordaA, wordbB, wordcC, answer;

do

System.out.println("Please enter all 3 side lengths of the triangle in any order.");
wordaA = JOptionPane.showInputDialog("Enter side 1:");
wordbB = JOptionPane.showInputDialog("Enter side 2:");
wordcC = JOptionPane.showInputDialog("Enter side 3:");
int aA = Integer.parseInt(wordaA);
int bB = Integer.parseInt(wordbB);
int cC = Integer.parseInt(wordcC);
triangleType(aA,bB,cC);
System.out.println("Would you like to enter another triangle?");
answer = JOptionPane.showInputDialog("Would you like to enter another triangle?");
while (answer.equalsIgnoreCase("yes"));



static void triangleType(int aA, int bB, int cC) b==c)
JOptionPane.showMessageDialog(null, "Triangle is Isosceles");

else
JOptionPane.showMessageDialog(null,"Triangle is Scalene");












share|improve this question


























  • I think you will find your life easier if you make several methods, such as isValidTriangle(int a, int b, int c) and isIsosceles(a, b, c) and put the specific logic in separate methods (also easier to test) rather than trying to deal with complex if/else if/else statements. A good general principle is that a method should do one thing well.

    – KevinO
    Mar 27 at 6:02


















1















I have an assignment to write a program that uses the method triangleType that i must write to take three int inputs from the user and output the triangle type. In the method, I first need to sort the integers in ascending order so that the comparisons I am required to use will work correctly. I know I did the sorting part in the code correctly, because I tested it before I even started trying to determine the triangle type. I am required to use these comparisons to find the triangle type: "if A + B <= C, then the sides do not represent a valid triangle. if A = C (all the sides must be the same length) then the triangle is EQUILATERAL. if A = B or B = C, then the triangle is ISOSCELES; otherwise the triangle is SCALENE"
For some reasons my if statements at the end of the triangleType method are not working correctly and I get all sorts of output, including "Invalid Triangle" plus other outputs no matter the integers that I enter.



package trianglemethod;

import javax.swing.JOptionPane;


public class TriangleMethod



public static void main(String[] args)

String wordaA, wordbB, wordcC, answer;

do

System.out.println("Please enter all 3 side lengths of the triangle in any order.");
wordaA = JOptionPane.showInputDialog("Enter side 1:");
wordbB = JOptionPane.showInputDialog("Enter side 2:");
wordcC = JOptionPane.showInputDialog("Enter side 3:");
int aA = Integer.parseInt(wordaA);
int bB = Integer.parseInt(wordbB);
int cC = Integer.parseInt(wordcC);
triangleType(aA,bB,cC);
System.out.println("Would you like to enter another triangle?");
answer = JOptionPane.showInputDialog("Would you like to enter another triangle?");
while (answer.equalsIgnoreCase("yes"));



static void triangleType(int aA, int bB, int cC) b==c)
JOptionPane.showMessageDialog(null, "Triangle is Isosceles");

else
JOptionPane.showMessageDialog(null,"Triangle is Scalene");












share|improve this question


























  • I think you will find your life easier if you make several methods, such as isValidTriangle(int a, int b, int c) and isIsosceles(a, b, c) and put the specific logic in separate methods (also easier to test) rather than trying to deal with complex if/else if/else statements. A good general principle is that a method should do one thing well.

    – KevinO
    Mar 27 at 6:02














1












1








1








I have an assignment to write a program that uses the method triangleType that i must write to take three int inputs from the user and output the triangle type. In the method, I first need to sort the integers in ascending order so that the comparisons I am required to use will work correctly. I know I did the sorting part in the code correctly, because I tested it before I even started trying to determine the triangle type. I am required to use these comparisons to find the triangle type: "if A + B <= C, then the sides do not represent a valid triangle. if A = C (all the sides must be the same length) then the triangle is EQUILATERAL. if A = B or B = C, then the triangle is ISOSCELES; otherwise the triangle is SCALENE"
For some reasons my if statements at the end of the triangleType method are not working correctly and I get all sorts of output, including "Invalid Triangle" plus other outputs no matter the integers that I enter.



package trianglemethod;

import javax.swing.JOptionPane;


public class TriangleMethod



public static void main(String[] args)

String wordaA, wordbB, wordcC, answer;

do

System.out.println("Please enter all 3 side lengths of the triangle in any order.");
wordaA = JOptionPane.showInputDialog("Enter side 1:");
wordbB = JOptionPane.showInputDialog("Enter side 2:");
wordcC = JOptionPane.showInputDialog("Enter side 3:");
int aA = Integer.parseInt(wordaA);
int bB = Integer.parseInt(wordbB);
int cC = Integer.parseInt(wordcC);
triangleType(aA,bB,cC);
System.out.println("Would you like to enter another triangle?");
answer = JOptionPane.showInputDialog("Would you like to enter another triangle?");
while (answer.equalsIgnoreCase("yes"));



static void triangleType(int aA, int bB, int cC) b==c)
JOptionPane.showMessageDialog(null, "Triangle is Isosceles");

else
JOptionPane.showMessageDialog(null,"Triangle is Scalene");












share|improve this question
















I have an assignment to write a program that uses the method triangleType that i must write to take three int inputs from the user and output the triangle type. In the method, I first need to sort the integers in ascending order so that the comparisons I am required to use will work correctly. I know I did the sorting part in the code correctly, because I tested it before I even started trying to determine the triangle type. I am required to use these comparisons to find the triangle type: "if A + B <= C, then the sides do not represent a valid triangle. if A = C (all the sides must be the same length) then the triangle is EQUILATERAL. if A = B or B = C, then the triangle is ISOSCELES; otherwise the triangle is SCALENE"
For some reasons my if statements at the end of the triangleType method are not working correctly and I get all sorts of output, including "Invalid Triangle" plus other outputs no matter the integers that I enter.



package trianglemethod;

import javax.swing.JOptionPane;


public class TriangleMethod



public static void main(String[] args)

String wordaA, wordbB, wordcC, answer;

do

System.out.println("Please enter all 3 side lengths of the triangle in any order.");
wordaA = JOptionPane.showInputDialog("Enter side 1:");
wordbB = JOptionPane.showInputDialog("Enter side 2:");
wordcC = JOptionPane.showInputDialog("Enter side 3:");
int aA = Integer.parseInt(wordaA);
int bB = Integer.parseInt(wordbB);
int cC = Integer.parseInt(wordcC);
triangleType(aA,bB,cC);
System.out.println("Would you like to enter another triangle?");
answer = JOptionPane.showInputDialog("Would you like to enter another triangle?");
while (answer.equalsIgnoreCase("yes"));



static void triangleType(int aA, int bB, int cC) b==c)
JOptionPane.showMessageDialog(null, "Triangle is Isosceles");

else
JOptionPane.showMessageDialog(null,"Triangle is Scalene");









java if-statement






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 27 at 9:35









Mureinik

197k24 gold badges161 silver badges219 bronze badges




197k24 gold badges161 silver badges219 bronze badges










asked Mar 27 at 5:58









SterlingHSterlingH

133 bronze badges




133 bronze badges















  • I think you will find your life easier if you make several methods, such as isValidTriangle(int a, int b, int c) and isIsosceles(a, b, c) and put the specific logic in separate methods (also easier to test) rather than trying to deal with complex if/else if/else statements. A good general principle is that a method should do one thing well.

    – KevinO
    Mar 27 at 6:02


















  • I think you will find your life easier if you make several methods, such as isValidTriangle(int a, int b, int c) and isIsosceles(a, b, c) and put the specific logic in separate methods (also easier to test) rather than trying to deal with complex if/else if/else statements. A good general principle is that a method should do one thing well.

    – KevinO
    Mar 27 at 6:02

















I think you will find your life easier if you make several methods, such as isValidTriangle(int a, int b, int c) and isIsosceles(a, b, c) and put the specific logic in separate methods (also easier to test) rather than trying to deal with complex if/else if/else statements. A good general principle is that a method should do one thing well.

– KevinO
Mar 27 at 6:02






I think you will find your life easier if you make several methods, such as isValidTriangle(int a, int b, int c) and isIsosceles(a, b, c) and put the specific logic in separate methods (also easier to test) rather than trying to deal with complex if/else if/else statements. A good general principle is that a method should do one thing well.

– KevinO
Mar 27 at 6:02













3 Answers
3






active

oldest

votes


















1














You have three different if statements there that are evaluated separately. Instead, from the description of the problem, it sounds like you need a single if statement with multiple condition branches (i.e., else if clauses):



if (a+b<=c)

JOptionPane.showMessageDialog(null,"Invalid Triangle");
else if (a==c)
JOptionPane.showMessageDialog(null,"Triangle is Equilateral");
else if (a==b || b==c)
JOptionPane.showMessageDialog(null, "Triangle is Isosceles");
else
JOptionPane.showMessageDialog(null,"Triangle is Scalene");






share|improve this answer
































    0














    I'm confused, why can't you just do



     if (a == b && b == c) 
    JOptionPane.showMessageDialog(null,"Triangle is Equilateral");
    else if ((a == b && a != c) || (a == c && a != b) || (b == c && b != a))
    JOptionPane.showMessageDialog(null, "Triangle is Isosceles");
    else if (a != b && a != c && b != c)
    JOptionPane.showMessageDialog(null,"Triangle is Scalene");
    else
    JOptionPane.showMessageDialog(null,"Invalid Triangle");






    share|improve this answer
































      0














      There's actually 2 issues.




      1. Let's say a=5, b=5, and c=5. The way your code is working right now it checks:

        if (a==c)



        which is true, so it prints "Triangle is Equilateral". Then it checks:

        if (a==b || b==c)



        which is also true, so it prints "Triangle is Isosceles".



        In order to prevent it from checking the next if statement once it finds the result you are looking for, all following if statements have to be "else if" statements. The final "else" code will run if all the else if statements above it are false. In your case, it will run as long as your third if statement is false.



      2. Also as Andronicus pointed out, the variables a, b, and c will remain 0 if any side is equal to another as your code only checks for inequalities



        Here is working code for the sorting part:

        if(aA>=bB && aA>=cC)
        a = aA;
        if(bB >= cC)
        b = bB;
        c = cC;
        else
        b = cC;
        c = bB;

        else if (bB >= aA && bB >= cC)
        a = bB;
        if(aA >= cC)
        b = aA;
        c = cC;
        else
        b = cC;
        a = aA;

        else
        a = cC;
        if(cC >= aA)
        b = cC;
        c = aA;
        else
        b = aA;
        c = cC;










      share|improve this answer





























        Your Answer






        StackExchange.ifUsing("editor", function ()
        StackExchange.using("externalEditor", function ()
        StackExchange.using("snippets", function ()
        StackExchange.snippets.init();
        );
        );
        , "code-snippets");

        StackExchange.ready(function()
        var channelOptions =
        tags: "".split(" "),
        id: "1"
        ;
        initTagRenderer("".split(" "), "".split(" "), channelOptions);

        StackExchange.using("externalEditor", function()
        // Have to fire editor after snippets, if snippets enabled
        if (StackExchange.settings.snippets.snippetsEnabled)
        StackExchange.using("snippets", function()
        createEditor();
        );

        else
        createEditor();

        );

        function createEditor()
        StackExchange.prepareEditor(
        heartbeatType: 'answer',
        autoActivateHeartbeat: false,
        convertImagesToLinks: true,
        noModals: true,
        showLowRepImageUploadWarning: true,
        reputationToPostImages: 10,
        bindNavPrevention: true,
        postfix: "",
        imageUploader:
        brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
        contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
        allowUrls: true
        ,
        onDemand: true,
        discardSelector: ".discard-answer"
        ,immediatelyShowMarkdownHelp:true
        );



        );













        draft saved

        draft discarded


















        StackExchange.ready(
        function ()
        StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55370676%2fif-statements-not-working-correctly-in-program-to-determine-triangle-type%23new-answer', 'question_page');

        );

        Post as a guest















        Required, but never shown

























        3 Answers
        3






        active

        oldest

        votes








        3 Answers
        3






        active

        oldest

        votes









        active

        oldest

        votes






        active

        oldest

        votes









        1














        You have three different if statements there that are evaluated separately. Instead, from the description of the problem, it sounds like you need a single if statement with multiple condition branches (i.e., else if clauses):



        if (a+b<=c)

        JOptionPane.showMessageDialog(null,"Invalid Triangle");
        else if (a==c)
        JOptionPane.showMessageDialog(null,"Triangle is Equilateral");
        else if (a==b || b==c)
        JOptionPane.showMessageDialog(null, "Triangle is Isosceles");
        else
        JOptionPane.showMessageDialog(null,"Triangle is Scalene");






        share|improve this answer





























          1














          You have three different if statements there that are evaluated separately. Instead, from the description of the problem, it sounds like you need a single if statement with multiple condition branches (i.e., else if clauses):



          if (a+b<=c)

          JOptionPane.showMessageDialog(null,"Invalid Triangle");
          else if (a==c)
          JOptionPane.showMessageDialog(null,"Triangle is Equilateral");
          else if (a==b || b==c)
          JOptionPane.showMessageDialog(null, "Triangle is Isosceles");
          else
          JOptionPane.showMessageDialog(null,"Triangle is Scalene");






          share|improve this answer



























            1












            1








            1







            You have three different if statements there that are evaluated separately. Instead, from the description of the problem, it sounds like you need a single if statement with multiple condition branches (i.e., else if clauses):



            if (a+b<=c)

            JOptionPane.showMessageDialog(null,"Invalid Triangle");
            else if (a==c)
            JOptionPane.showMessageDialog(null,"Triangle is Equilateral");
            else if (a==b || b==c)
            JOptionPane.showMessageDialog(null, "Triangle is Isosceles");
            else
            JOptionPane.showMessageDialog(null,"Triangle is Scalene");






            share|improve this answer













            You have three different if statements there that are evaluated separately. Instead, from the description of the problem, it sounds like you need a single if statement with multiple condition branches (i.e., else if clauses):



            if (a+b<=c)

            JOptionPane.showMessageDialog(null,"Invalid Triangle");
            else if (a==c)
            JOptionPane.showMessageDialog(null,"Triangle is Equilateral");
            else if (a==b || b==c)
            JOptionPane.showMessageDialog(null, "Triangle is Isosceles");
            else
            JOptionPane.showMessageDialog(null,"Triangle is Scalene");







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Mar 27 at 6:04









            MureinikMureinik

            197k24 gold badges161 silver badges219 bronze badges




            197k24 gold badges161 silver badges219 bronze badges


























                0














                I'm confused, why can't you just do



                 if (a == b && b == c) 
                JOptionPane.showMessageDialog(null,"Triangle is Equilateral");
                else if ((a == b && a != c) || (a == c && a != b) || (b == c && b != a))
                JOptionPane.showMessageDialog(null, "Triangle is Isosceles");
                else if (a != b && a != c && b != c)
                JOptionPane.showMessageDialog(null,"Triangle is Scalene");
                else
                JOptionPane.showMessageDialog(null,"Invalid Triangle");






                share|improve this answer





























                  0














                  I'm confused, why can't you just do



                   if (a == b && b == c) 
                  JOptionPane.showMessageDialog(null,"Triangle is Equilateral");
                  else if ((a == b && a != c) || (a == c && a != b) || (b == c && b != a))
                  JOptionPane.showMessageDialog(null, "Triangle is Isosceles");
                  else if (a != b && a != c && b != c)
                  JOptionPane.showMessageDialog(null,"Triangle is Scalene");
                  else
                  JOptionPane.showMessageDialog(null,"Invalid Triangle");






                  share|improve this answer



























                    0












                    0








                    0







                    I'm confused, why can't you just do



                     if (a == b && b == c) 
                    JOptionPane.showMessageDialog(null,"Triangle is Equilateral");
                    else if ((a == b && a != c) || (a == c && a != b) || (b == c && b != a))
                    JOptionPane.showMessageDialog(null, "Triangle is Isosceles");
                    else if (a != b && a != c && b != c)
                    JOptionPane.showMessageDialog(null,"Triangle is Scalene");
                    else
                    JOptionPane.showMessageDialog(null,"Invalid Triangle");






                    share|improve this answer













                    I'm confused, why can't you just do



                     if (a == b && b == c) 
                    JOptionPane.showMessageDialog(null,"Triangle is Equilateral");
                    else if ((a == b && a != c) || (a == c && a != b) || (b == c && b != a))
                    JOptionPane.showMessageDialog(null, "Triangle is Isosceles");
                    else if (a != b && a != c && b != c)
                    JOptionPane.showMessageDialog(null,"Triangle is Scalene");
                    else
                    JOptionPane.showMessageDialog(null,"Invalid Triangle");







                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Mar 27 at 6:07









                    chrischris

                    514 bronze badges




                    514 bronze badges
























                        0














                        There's actually 2 issues.




                        1. Let's say a=5, b=5, and c=5. The way your code is working right now it checks:

                          if (a==c)



                          which is true, so it prints "Triangle is Equilateral". Then it checks:

                          if (a==b || b==c)



                          which is also true, so it prints "Triangle is Isosceles".



                          In order to prevent it from checking the next if statement once it finds the result you are looking for, all following if statements have to be "else if" statements. The final "else" code will run if all the else if statements above it are false. In your case, it will run as long as your third if statement is false.



                        2. Also as Andronicus pointed out, the variables a, b, and c will remain 0 if any side is equal to another as your code only checks for inequalities



                          Here is working code for the sorting part:

                          if(aA>=bB && aA>=cC)
                          a = aA;
                          if(bB >= cC)
                          b = bB;
                          c = cC;
                          else
                          b = cC;
                          c = bB;

                          else if (bB >= aA && bB >= cC)
                          a = bB;
                          if(aA >= cC)
                          b = aA;
                          c = cC;
                          else
                          b = cC;
                          a = aA;

                          else
                          a = cC;
                          if(cC >= aA)
                          b = cC;
                          c = aA;
                          else
                          b = aA;
                          c = cC;










                        share|improve this answer































                          0














                          There's actually 2 issues.




                          1. Let's say a=5, b=5, and c=5. The way your code is working right now it checks:

                            if (a==c)



                            which is true, so it prints "Triangle is Equilateral". Then it checks:

                            if (a==b || b==c)



                            which is also true, so it prints "Triangle is Isosceles".



                            In order to prevent it from checking the next if statement once it finds the result you are looking for, all following if statements have to be "else if" statements. The final "else" code will run if all the else if statements above it are false. In your case, it will run as long as your third if statement is false.



                          2. Also as Andronicus pointed out, the variables a, b, and c will remain 0 if any side is equal to another as your code only checks for inequalities



                            Here is working code for the sorting part:

                            if(aA>=bB && aA>=cC)
                            a = aA;
                            if(bB >= cC)
                            b = bB;
                            c = cC;
                            else
                            b = cC;
                            c = bB;

                            else if (bB >= aA && bB >= cC)
                            a = bB;
                            if(aA >= cC)
                            b = aA;
                            c = cC;
                            else
                            b = cC;
                            a = aA;

                            else
                            a = cC;
                            if(cC >= aA)
                            b = cC;
                            c = aA;
                            else
                            b = aA;
                            c = cC;










                          share|improve this answer





























                            0












                            0








                            0







                            There's actually 2 issues.




                            1. Let's say a=5, b=5, and c=5. The way your code is working right now it checks:

                              if (a==c)



                              which is true, so it prints "Triangle is Equilateral". Then it checks:

                              if (a==b || b==c)



                              which is also true, so it prints "Triangle is Isosceles".



                              In order to prevent it from checking the next if statement once it finds the result you are looking for, all following if statements have to be "else if" statements. The final "else" code will run if all the else if statements above it are false. In your case, it will run as long as your third if statement is false.



                            2. Also as Andronicus pointed out, the variables a, b, and c will remain 0 if any side is equal to another as your code only checks for inequalities



                              Here is working code for the sorting part:

                              if(aA>=bB && aA>=cC)
                              a = aA;
                              if(bB >= cC)
                              b = bB;
                              c = cC;
                              else
                              b = cC;
                              c = bB;

                              else if (bB >= aA && bB >= cC)
                              a = bB;
                              if(aA >= cC)
                              b = aA;
                              c = cC;
                              else
                              b = cC;
                              a = aA;

                              else
                              a = cC;
                              if(cC >= aA)
                              b = cC;
                              c = aA;
                              else
                              b = aA;
                              c = cC;










                            share|improve this answer















                            There's actually 2 issues.




                            1. Let's say a=5, b=5, and c=5. The way your code is working right now it checks:

                              if (a==c)



                              which is true, so it prints "Triangle is Equilateral". Then it checks:

                              if (a==b || b==c)



                              which is also true, so it prints "Triangle is Isosceles".



                              In order to prevent it from checking the next if statement once it finds the result you are looking for, all following if statements have to be "else if" statements. The final "else" code will run if all the else if statements above it are false. In your case, it will run as long as your third if statement is false.



                            2. Also as Andronicus pointed out, the variables a, b, and c will remain 0 if any side is equal to another as your code only checks for inequalities



                              Here is working code for the sorting part:

                              if(aA>=bB && aA>=cC)
                              a = aA;
                              if(bB >= cC)
                              b = bB;
                              c = cC;
                              else
                              b = cC;
                              c = bB;

                              else if (bB >= aA && bB >= cC)
                              a = bB;
                              if(aA >= cC)
                              b = aA;
                              c = cC;
                              else
                              b = cC;
                              a = aA;

                              else
                              a = cC;
                              if(cC >= aA)
                              b = cC;
                              c = aA;
                              else
                              b = aA;
                              c = cC;











                            share|improve this answer














                            share|improve this answer



                            share|improve this answer








                            edited Mar 27 at 6:52

























                            answered Mar 27 at 6:05









                            Anthony YershovAnthony Yershov

                            227 bronze badges




                            227 bronze badges






























                                draft saved

                                draft discarded
















































                                Thanks for contributing an answer to Stack Overflow!


                                • Please be sure to answer the question. Provide details and share your research!

                                But avoid


                                • Asking for help, clarification, or responding to other answers.

                                • Making statements based on opinion; back them up with references or personal experience.

                                To learn more, see our tips on writing great answers.




                                draft saved


                                draft discarded














                                StackExchange.ready(
                                function ()
                                StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55370676%2fif-statements-not-working-correctly-in-program-to-determine-triangle-type%23new-answer', 'question_page');

                                );

                                Post as a guest















                                Required, but never shown





















































                                Required, but never shown














                                Required, but never shown












                                Required, but never shown







                                Required, but never shown

































                                Required, but never shown














                                Required, but never shown












                                Required, but never shown







                                Required, but never shown







                                Popular posts from this blog

                                Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

                                SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

                                은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현