Question: Homework fast I have the following program in C which checks if three integers can form a triangle, and if they can then checks the

Homework fast

I have the following program in C which checks if three integers can form a triangle, and if they can then checks the type of triangle they form equilateral , isosceles, staggered.

#include

02: #include

03: void triangle_check(int a, int b, int c);

04:

05: int main(){

06: int a=0,b=0,c=0;

07: printf("Give three positive integers: ");

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

09: triangle_check(a,b,c);

10: return 0;

11:}

12:

13: void triangle_check(int a, int b, int c){

14: //Function assumes positive integers are passed

15: printf("Sides given were: a=%d, b=%d, c=%d ", a, b, c); 16:

17:

if ((a>b+c) || (b>a+c) || (c>b+a)) { printf("Invalid triangle "); exit(1);

18:

19: }

20:

21: if(a==b && b==c){ 22:

printf("Equilateral Triangle ");

23:

} 24: else if(a= b || bc || a=c){

25:

printf("Isosceles Triangle ");

26: } 27: else{

28:

printf("Scalene Triangle "); 29:

30: }

1) construct the circuit complexity graph and calculate the circuit complexity.

2)record the key paths and design the test cases based on the key execution path testing technique.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!