Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 5 (20 marks) (a) List TWO advantages of using functions in a C-Program. (4 marks) (b) Write the implementation of a C-Program function named

image text in transcribed
Question 5 (20 marks) (a) List TWO advantages of using functions in a C-Program. (4 marks) (b) Write the implementation of a C-Program function named Checksign that takes as input an integer number and returns a T if the number is positive, a 1' if the number is negative, or otherwise it returns a 'o'. (5 marks) (c) Consider the following C-Program. #include int main(void) int myArr[]=(-2,3,-4): /* Your code goes here */ return 0; Complete the program above so that it performs the following task: The program will need to make function calls to the checksign function defined in (b) to check the sign of the each value in the array myrrt] and will need to convert any negative value to a positive value. (4 marks) (d) Explain what you understand by the term "modular decomposition' when writing C- programs. (3 marks) (e) List TWO advantages of using a modular decomposition approach when coding C. programs. (4 marks)

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 Systems Design Implementation And Management

Authors: Peter Robb,Carlos Coronel

5th Edition

061906269X, 9780619062699

More Books

Students also viewed these Databases questions

Question

What tests may be conducted for identifying application errors?

Answered: 1 week ago