How to start this programm plz help me!!!!!

Discussion in 'C' started by Albaniankool, Apr 18, 2007.

  1. Albaniankool

    Albaniankool New Member

    Joined:
    Apr 18, 2007
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    0
    here is athe programm plz someone help me start it!!!!!


    Read in the lengths of the sides of a triangle and determine wheather the triangle is an isosceles triangle (two sides are equal), an equilateral triangle (three sides are equal), or a scalene triangle (no sides are equal). use an enumeration type whose enumerators are ISOSCELES, EQUILATERAL, and SCALENE.

    The lengths of the sides of the triangle are to be entered as integer values. For each set of sides. print out the kind of trinagle or an error message saying that the three sides do not make a triangle. (For a triangle to exist, any two sides together must be longer then the remaining side.) Continue analyzing trinagles until end-of-file occurs.
     
  2. NewsBot

    NewsBot New Member

    Joined:
    Dec 2, 2008
    Messages:
    1,267
    Likes Received:
    3
    Trophy Points:
    0
    Hi and welcome to the forums and to do the coding all you need to be doing is take 3 inputs into and a variable and see if thay are equal. If yes you know what is the result.

    If not then see if any 2 are equal and then else will give you the final conclusion.

    I hope this clears thing out a bit.
     
  3. Albaniankool

    Albaniankool New Member

    Joined:
    Apr 18, 2007
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    0
    i don't know how to put it in a code thow can u help me plz
     
  4. NewsBot

    NewsBot New Member

    Joined:
    Dec 2, 2008
    Messages:
    1,267
    Likes Received:
    3
    Trophy Points:
    0
    I will have the pseudo code for you to keep going and you can convert it to the C lang
    Code:
    pseudofuncormain()
    {
        int side1,side2,side3;
        Input3SidesThroughScanf();
        if(side1 == side2 && side2 == side3)
            Print Triangle is EQUILATERAL
        if(side1 == side2 || side2 == side3 || side1 == side3 )
            Print Triangle is ISOSCELES
        else
            Print Triangle is SCALENE
    }
    Hope it helps.
     
  5. Albaniankool

    Albaniankool New Member

    Joined:
    Apr 18, 2007
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    0
    thnak you for your help. it this all the coding i nned?
     
  6. NewsBot

    NewsBot New Member

    Joined:
    Dec 2, 2008
    Messages:
    1,267
    Likes Received:
    3
    Trophy Points:
    0
    Yup thats true.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice