1. void main () 2. { 3. int a, b, c, x = 0, y = 0; 4. clrscr ( ); 5. printf ("Enter three numbers: "); 6. scanf ("%d %d %d", &a, &b, &c); 7. if (a > b) && (a > c) { 8. x = a * a + b * b; 9. } 10. If (b > c) { 11. у %3Dа*а-b* b; 12.} 13. printf ("x = %d y = %d", x, y); 14. getch ( ); 15.} ww wwww Figure 1

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter8: Arrays And Strings
Section: Chapter Questions
Problem 10PE
icon
Related questions
Question
Figure below shows an excerpt of an algorithm.
1. void main ()
2. {
3. int a, b, c, х%3D0, у %3D 0%;
4. clrscr ( );
5. printf ("Enter three numbers: ");
6. scanf ("%d %d %d", &a, &b, &c);
7. if ((a > b) && (a > c) {
8. х%3Dа*а +b* b;
9. }
10. If (b > c) {
11. у %3Dа*а—b * b;
12.}
13. printf ("x %3D %d y %3D %d", х, у);
14. getch ( );
15.}
Figure 1
a)
Draw the flow graph.
b)
Calculate the cyclomatic complexity using THREE (3) different approaches.
c)
List out all the possible Basis Paths.
d)
Do simple test case based on basis paths.
Transcribed Image Text:Figure below shows an excerpt of an algorithm. 1. void main () 2. { 3. int a, b, c, х%3D0, у %3D 0%; 4. clrscr ( ); 5. printf ("Enter three numbers: "); 6. scanf ("%d %d %d", &a, &b, &c); 7. if ((a > b) && (a > c) { 8. х%3Dа*а +b* b; 9. } 10. If (b > c) { 11. у %3Dа*а—b * b; 12.} 13. printf ("x %3D %d y %3D %d", х, у); 14. getch ( ); 15.} Figure 1 a) Draw the flow graph. b) Calculate the cyclomatic complexity using THREE (3) different approaches. c) List out all the possible Basis Paths. d) Do simple test case based on basis paths.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 5 steps with 2 images

Blurred answer
Knowledge Booster
Function Arguments
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning