Write minimum test cases for branch coverage.

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter5: Repetition Statements
Section: Chapter Questions
Problem 7PP
icon
Related questions
Question

Write minimum test cases for branch coverage.

void main()
{
1. float A,B,C;
2. clrscr();
3. printf("Enter number 1:\n");
4. scanf("%f", &A);
5. printf("Enter number 2:\n");
6. scanf("%f", &B);
7. printf("Enter number 3:\n");
8. scanf("%f", &C);
9. if(A>B) {
10.
if(A>C) {
printf("The largest number is: %f\n",A);
11.
}
12.
else {
13.
printf("The largest number is: %f\n",C);
}
}
14. else {
15.
if(C>B) {
16.
printf("The largest number is: %f\n",C);
}
else {
17.
18.
printf("The largest number is: %f\n",B);
}
}
19. getch();
}
Transcribed Image Text:void main() { 1. float A,B,C; 2. clrscr(); 3. printf("Enter number 1:\n"); 4. scanf("%f", &A); 5. printf("Enter number 2:\n"); 6. scanf("%f", &B); 7. printf("Enter number 3:\n"); 8. scanf("%f", &C); 9. if(A>B) { 10. if(A>C) { printf("The largest number is: %f\n",A); 11. } 12. else { 13. printf("The largest number is: %f\n",C); } } 14. else { 15. if(C>B) { 16. printf("The largest number is: %f\n",C); } else { 17. 18. printf("The largest number is: %f\n",B); } } 19. getch(); }
Expert Solution
steps

Step by step

Solved in 5 steps

Blurred answer
Knowledge Booster
Analysis of Performance Measurement
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++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage