Question

Given the following heading for a user-defined function, what would be the correct way to call this function from inside main
0 0
Add a comment Improve this question Transcribed image text
Answer #1

a call to Syntax Function in c/ch from main function follows is int main() 3 name Variable-name = function headu(); return 0;

Add a comment
Know the answer?
Add Answer to:
Given the following heading for a user-defined function, what would be the correct way to call...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Assume a function named findMin has been defined to return the Index position of the smallest...

    Assume a function named findMin has been defined to return the Index position of the smallest value in an array of double values. Which of the following would be the correct way to call the findin function from main, given the following array definition: double areas () - (5.2. 12.3, 7.0.3.4, 6,8); a, int smallloc = findMin ( areas); b. int smallloc - findMin ( areas [1.5); c. int small.oc - findMin ( areas, 5); d. double smallloc = find...

  • Assume a function named find Min has been defined to return the index position of the...

    Assume a function named find Min has been defined to return the index position of the smallest value in an array of double values. Which of the following would be the correct way to call the findMin function from main , given the following array definition: double areas [ ] = {5.2. 12.3, 7.0, 3.4, 6.8 }; a. int smallLoc = findMin ( areas); b. int smallLoc = findMin ( areas [ ],5); O c. int smallLoc = findMin (...

  • The function used in the following program is supposed to take 2 parameters (arguments) and switch...

    The function used in the following program is supposed to take 2 parameters (arguments) and switch the contents of the 2 and send them back to the calling program, but the values are not swapped and both have the same number in them. Select the option that fixes the problem? void interchange(int &arg1, int &arg2) { arg2 = arg1; arg1 = arg2 ; } int main() { int num1 = 4 , num2 = 5; interchange(num1, num2); cout << "Number...

  • Write a C program that prompts the user to enter a binary value, multiplies it by...

    Write a C program that prompts the user to enter a binary value, multiplies it by ten, then displays the result in binary. (“Binary” here means that the user communicates with the program in ones and zeros.) Your main function should a) declare a char array, b) call the readLn function to read from the keyboard c) call a function to convert the input text string to an int d) multiply the int by ten e) call a function to...

  • In an c program findMax.c, if the main() function is defined as follows. int main (...

    In an c program findMax.c, if the main() function is defined as follows. int main ( int argc, char *argv[] ) After compilation, the executable is named as findMax. Answer the following questions if the user runs the executable by typing the following command? > findMax 20 30 40 50 60 test a. Write out the value of argc? b. Write out the array of character strings of argv?

  • A student has written the following user-defined function to compute the total cost of a dinner...

    A student has written the following user-defined function to compute the total cost of a dinner for some number of guests. The parameters for this function are the cost per meal (a double) and the number of guests (an integer). There seem to be some errors in the code--what are they? Code written by the student: int dinnerCost ( double mealCost, guests) int total = mealCost * guests; The student failed to declare the datatype of guests as int in...

  • 1. A(n) ____________________ is a variable or expression listed in a call to a function. 2....

    1. A(n) ____________________ is a variable or expression listed in a call to a function. 2. The pass by ____________________ mechanism must be used if the calling code is to receive information back from the function. 3. True or False? If there are several items in a parameter list, the compiler matches the parameters and arguments by their relative positions in the parameter and argument lists. 4. True or False? In C++, a function definition may have another function definition...

  •            Suppose the following variable are defined in a function, char line[80], comm[20], p1[20], p2[20]; int...

               Suppose the following variable are defined in a function, char line[80], comm[20], p1[20], p2[20]; int n; Where line is the complete line entered by the user, comm is the first word on the line, p1 and p2 are the second and third words (if present), and n is the number of words on the line. If you were to pass these to a function called breakup, what would the function call look like? What would the function header look...

  • Create qz5.c to include all of the following function prototypes: void check1(char *, char, int *);...

    Create qz5.c to include all of the following function prototypes: void check1(char *, char, int *); void check2(char *, char, int *); void display(char, int); Then, implement main() to perform the tasks below: Define a 10-element char array with initial values of any lower case letters of your selection. Values can duplicate. Define a pointer that points to the above array. Print the array completely with double spaces before each character. See screenshot below for a sample. Call check1() with...

  • Name your c++ file cpp. BScore_LastNameFirstName.cpp Write a program that contains a function call Input. The...

    Name your c++ file cpp. BScore_LastNameFirstName.cpp Write a program that contains a function call Input. The Input function should accept 2 decimal test scores that was entered from the user and stores them in an array. Don’t store any number less than 0. Return the array to main. Inside main, the program should pass the array and the total number of scores to countBGrade function. The countBGrade function should count how many B scores (80 to 89) were entered by...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT