Question: Please I need a FULL answer A,B,C,D (CODE+FLOECHART) before 24 hours Question 4 [Total: 20 Marks] (a) Consider the following C-program that fails to compile

Please I need a FULL answer A,B,C,D (CODE+FLOECHART) before 24 hours Question4 [Total: 20 Marks] (a) Consider the following C-program that fails tocompile due to syntax errors. Identify the errors and correct the programPlease I need a FULL answer A,B,C,D (CODE+FLOECHART) before 24 hours

Question 4 [Total: 20 Marks] (a) Consider the following C-program that fails to compile due to syntax errors. Identify the errors and correct the program so that it compiles successfully. What will be the output when the program is executed successfully? [9 Marks] #include #include void function 040; 1, y = 5; 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. int main() { function (); function (); function 0; return 0; function 040 { int x = 1; static int y = 100; } printf("= ", x); printf("y= ", y); 19. 20. 21. X++; y++ } (b) Consider the C-program in Q4(a), Explain the purpose of the keyword static. [3 Marks] Consider the C-program in Q4(a), identify the global and local variables. What is the importance of global variables in a C-program? (c) (d) Consider the following C fragment: if(a ==5) { printf("a is 5 "); } else if (a { printf("a is 4 "); } else { printf("a is unknown "); } Re-write this fragment using a switch statement [5 Marks]

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!