Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

15 2. Consider the code below. a. It contains four errors that prevent it from being properly compiled (syntax errors). For each of these errors

image text in transcribed
15 2. Consider the code below. a. It contains four errors that prevent it from being properly compiled (syntax errors). For each of these errors identify it by indicating the code line and explain how it can be fixed so that the program is successfully compiled. b. Line 9 does not contain any syntax error. However, there is a logical error that will prevent the code from correct execution. What is this error? 5 1. #include 2. 3. int main() 5. char Choice; 6. int nfact-21; 7. 8. printf("Multiply Menuina:3 b:5 e:9 "); 9. scanf("d", fchoice); 10. 11. 1ficChoice w'a' WcChoice we') 12. nfact-3; 13. else (cChoice !'b') nfact fact5; 15. if (choise we') 16. nfact=3; 17. printf("Result is ts "infact): 18. 19. return 0; 20

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

Database Design And Relational Theory Normal Forms And All That Jazz

Authors: Chris Date

1st Edition

1449328016, 978-1449328016

More Books

Students also viewed these Databases questions