Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Conceptual Database Design An Entity Relationship Approach

Authors: Carol Batini, Stefano Ceri, Shamkant B. Navathe

1st Edition

ISBN: 0805302441, 978-0805302448

More Books

Students also viewed these Databases questions

Question

L A -r- P[N]

Answered: 1 week ago