Question: C programming questions. 1. Why do functions have prototypes? 2. What is the purpose of a formal parameter? 3. What is the purpose of an

C programming questions.

1. Why do functions have prototypes?

2. What is the purpose of a formal parameter?

3. What is the purpose of an actual parameter?

4. What is the NOT principle? Why is it important?

5. Why would you use a formal parameter to get data into a function when you could use a symbolic constant instead? Explain.

6. List the advantages and disadvantages of cohesive functions.

7. If given the choice between writing your own function or using a library function, can you think of situations where it would be preferable to write your own?

8. Why would you want to use a void function? Give some examples.

9. What are the advantages of top-down design?

10. Do cohesive functions promote or discourage code reuse? Explain your answer.

11. Explain in your own words what is meant by procedural abstraction.

12. A light year is a unit of astronomical distance that measures how far light can travel in one year, defined as 365.25 days, which is about 9.4507 x 1012, or about 5.878 trillion miles. A parsec is a unit of astronomical distance, equal to about 3.26 light years. One parsec corresponds to the distance at which the mean radius of the earth's orbit subtends an angle of one second of arc. Since the numbers grow so large so quickly, it's often easier for astronomers to work with parsecs, and convert them back to light years, or even miles, when needed. Write a function to convert parsecs to light years.

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!