๐Ÿ”’ Closed C language pa help po

Status
Not open for further replies.

zacha

Forum Veteran
1652976723904.webp
 
Baka mali ako ah, matagal na ito eh
Ok, so basically malalaman mo na triangle pag inadd mo lahat ng angles, 180 degrees dapat.
Isosceles - 2 angles are the same
Equilateral - all angles are the same
Scalene - no same angle?

C:
#include <stdio.h>

main()
{
    float angle1, angle2, angle3;
   
    printf("Enter first angle of the triangle: ");
    scanf_s("%f", &angle1);
    printf("Enter second angle of the triangle: ");
    scanf_s("%f", &angle2);
    printf("Enter third angle of the triangle: ");
    scanf_s("%f", &angle3);

    if ((angle1 + angle2 + angle3) == 180)
    {
        if ((angle1 == angle2) && (angle2 == angle3))
        {
            printf("Equilateral triangle");
        }
        else if ((angle1 == angle2) || (angle2 == angle3) || (angle1 == angle2))
        {
            printf("Isosceles triangle");
        }
        else
        {
            printf("Scalene triangle");
        }
    }
    else
    {
        printf("It is not a triangle");
    }


    getch();
    getch();
}
 
Baka mali ako ah, matagal na ito eh
Ok, so basically malalaman mo na triangle pag inadd mo lahat ng angles, 180 degrees dapat.
Isosceles - 2 angles are the same
Equilateral - all angles are the same
Scalene - no same angle?

C:
#include <stdio.h>

main()
{
    float angle1, angle2, angle3;
 
    printf("Enter first angle of the triangle: ");
    scanf_s("%f", &angle1);
    printf("Enter second angle of the triangle: ");
    scanf_s("%f", &angle2);
    printf("Enter third angle of the triangle: ");
    scanf_s("%f", &angle3);

    if ((angle1 + angle2 + angle3) == 180)
    {
        if ((angle1 == angle2) && (angle2 == angle3))
        {
            printf("Equilateral triangle");
        }
        else if ((angle1 == angle2) || (angle2 == angle3) || (angle1 == angle2))
        {
            printf("Isosceles triangle");
        }
        else
        {
            printf("Scalene triangle");
        }
    }
    else
    {
        printf("It is not a triangle");
    }


    getch();
    getch();
}[/C
[/QUOTE]
salamat paps!!
 
Status
Not open for further replies.

About this Thread

  • 2
    Replies
  • 329
    Views
  • 2
    Participants
Last reply from:
zacha

Online now

Members online
786
Guests online
656
Total visitors
1,442

Forum statistics

Threads
2,276,942
Posts
28,973,215
Members
1,229,649
Latest member
themaharaja
Back
Top