program 10: Accept three   sides of triangle as input and print whether the triangle is valid or not.   #include<stdio.h> void m...

C Program to find whether the triangle is valid or not.

 





program 10: Accept three sides of triangle as input and print whether the triangle is valid or not.

 #include<stdio.h>

void main()

{

    int a,b,c;

    printf("Enter three sides of triangle:");

    scanf("%d%d%d",&a,&b,&c);

    if((a+b)>c)

    {

        printf("\nTriangle is valid");

    }

    else

    {

        printf("\nTriangle is invalid");

    }

}

Output

[root@dhcppc0 SetB]# ./a.out

Enter three sides of triangle:3 6 8

Triangle is vaild


 

 

0 coment�rios:

HTML5 CSS3 TUTORIAL FOR BEGINNERS