I l @ ve RuBoard |
What is the difference between an actual argument and a formal argument?
Write ANSI C function headings for the following functions described. Note we are asking just for the headings, not the body.
donut() takes an int argument and prints that number of 0s .
gear() takes two int arguments and returns type int .
stuff_it() takes a double and the address of a double variable and stores the first value in the given location.
Write ANSI C function headings for the following functions described. Note that you need write only the headings, not the body.
n_to_char() takes an int argument and returns a char .
digits() takes a double argument and an int argument and returns an int .
random() takes no argument and returns an int .
Devise a function that returns the sum of two integers.
What changes, if any, would you need to make to have the function of Question 4 add two double numbers instead?
Devise a function alter() that takes two int variables x and y and changes their values to their sum and their difference, respectively.
Is anything wrong with this function definition?
void salami(num) { int num, count; for (count = 1; count <= num; num++) printf(" O salami mio!\n"); }
Write a function that returns the largest of three integer arguments.
Given the following output:
Please choose one of the following: 1) copy files 2) move files 3) remove files 4) quit Enter the number of your choice:
Write a function that displays a menu of four numbered choices and asks you to choose one. (The output should look like the preceding .)
Write a function that has two int arguments: a lower limit and an upper limit. The function should read an integer from input. If the integer is outside the limits, the function should print a menu again (using the function from part a. of this question) to reprompt the user , and get a new value. When an integer in the proper limits is entered, the function should return that value to the calling function.
Write a minimal program using the functions from parts a. and b. of this question. By minimal, we mean it need not actually perform the actions promised by the menu; it should just show the choices and get a valid response.
I l @ ve RuBoard |