Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

7 . 1 1 LAB: Calling Functions In Loops Problem In C: Construct a program that makes us of a function inside of a loop

7.11 LAB: Calling Functions In Loops
Problem In C:
Construct a program that makes us of a function inside of a loop to count down from some positive integer value until the value equals 0. Create a user function that you create that takes an integer as an argument, verifies that the value is valid and prints messages and returns values based on that value. If the value is larger than 0, print the value and a newline to standard output, then return a 1 to the calling function, indicating it is a good value and to keep going. If the value passed to the function is 0, print the value and the message "Blast Off" then return a value to the calling function of 0 and if it is less than 0, return a -1 to the calling function.
In the main function, create a loop that is controlled by a user provided integer input value and calls the function you created and uses the return value to either quit or decrement the value and continue calling the function in the loop.
Objective:
Demonstrate declaring a User Defined Function.
Demonstrate Pass By Value.
Demonstrate Calling Functions in loops.
Example output
525740.3889364 qx3zqy?
image text in transcribed

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

Graph Databases

Authors: Ian Robinson, Jim Webber, Emil Eifrem

1st Edition

1449356265, 978-1449356262

More Books

Students also viewed these Databases questions

Question

KEY QUESTION Refer to Figure 3.6, page

Answered: 1 week ago