Question

When a function is called by its name during the execution of a program, then it is a. executed b. located C. defined d. expo
0 0
Add a comment Improve this question Transcribed image text
Answer #1

when a function is called by its name during the execution of a program, then it is executed.

Function call contains the name of the function being executed and list of values to be assigned to the parameters in the function definition. The statement inside the function are not executed until it is called.

Addition of two numbers using function call example:

int main()

{

int a=5,b=20;

sum=addnum(a,b);

printf("Addition of 2 numbers is :");

printf("%d",sum);

return 0;

}

int addnum(int n1,int n2)

{

int result;

result=n1+n2;

return result;

}

output:

Addition of 2 numbers is 25

Add a comment
Know the answer?
Add Answer to:
When a function is called by its name during the execution of a program, then it...
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
  • (A) Assume that a function has been called and the $ra is now0x00404010. The PC is...

    (A) Assume that a function has been called and the $ra is now0x00404010. The PC is currently 0x00402000. What is the address of the jal instruction that called the function? (B) Assume that a function has been called and the $ra is now 0x0040400C. The PC is currently 0x00402000. What is the address of the jal instruction that called the function? (C) A function is called using a jal instruction. The jal instruction is located at 0x00402000. The function is...

  • Java Test 1 Name 1) A Java program is best classified as arsge D) pnocesorE) aa...

    Java Test 1 Name 1) A Java program is best classified as arsge D) pnocesorE) aa 2) 6 bits can be used to represent 3) Binary numbers are composed entirely of ? 4) Define the main method for a Java program 5) Give 2 examples of a legal Java identifier? distinct items or values? 6) A unique aspect of Java that allows code compiled on one machine to be executed on a machine of a different hardware platform is Java's...

  • suppose that execution time for a program is directly proportional to instruction access time and that...

    suppose that execution time for a program is directly proportional to instruction access time and that access to an instruction in the cache is 20 times faster than access to an instruction in the main memory. assume that there is 96% chance to find the requested instruction in the cache (probability to find the requested instruction in the cache is 0.96), and also assume that if an instruction is not found in the cache, it must be first fetched from...

  • Most systems allow a program to allocate more memory to its address space during execution. Allocation...

    Most systems allow a program to allocate more memory to its address space during execution. Allocation of data in the heap segments of programs is and example of such allocated memory. What is required to support dynamic memor allocation in the following schemes? a. Contiguous memory allocation b. Pure segmentation c. Pure paging Explain each of the above schemes and provide sources to back your answers.

  • 7.11. During the course of execution of a program, the processor will increment the contents of t...

    need helo with 7.11 1 and 2 7.11. During the course of execution of a program, the processor will increment the contents of the instruction register (program counter) by one word after each instruction fetch, but will alter the contents of that register if it encounters a branch or call instruction that causes execution to continue elsewhere in the program. Now consider Figure 7.8 . There are two alternatives with respect to instruction addresses: Maintain a relative address in the...

  • programming languages in #f language QUESTION 4 Consider the following skeletal C program: void funi(void); /*...

    programming languages in #f language QUESTION 4 Consider the following skeletal C program: void funi(void); /* prototype */ void fun2(void); /* prototype */ void fun3(void); /* prototype */ void main() { int a, b, c; void fun1(void) { int b, c, d; void fun2 (void) { int c, d, e; void fun3(void) { int d, e, f, Assuming that dynamic scoping is used, what variables are visible during execution of the last function called in following calling sequence: main calls...

  • Do not prompt the user for input during the execution of your program. Do not pause...

    Do not prompt the user for input during the execution of your program. Do not pause at the end of the execution waiting for the user's input. Important notes: from now on, function prototypes should be written before the main function. And function definitions should be written after the main function. 10% will be deducted if this is not observed. Zybooks MODULES: MODULE 6 a.) (Lab4a.cpp) Chapter 6, “Falling Distance." The following formula can be used to determine the distance...

  • Once the above function is defined, it can be called by its name, for example, primesUpTo(1000000)...

    Once the above function is defined, it can be called by its name, for example, primesUpTo(1000000) 1. Build a histogram of the leading digits (first significant digits) of the primes up to 1,000,000. 2. What is the relative frequency of 1s among the leading digits of the primes up to 1,000,000?

  • Write the following program in C Language using standard library functions. /*Implement the Find function, called...

    Write the following program in C Language using standard library functions. /*Implement the Find function, called in the program below. This function receives two strings, and looks for the first occurrence of the second string in the first string, returning the number of characters it is in, relative to the beginning of the first string. If not, returns -1. In the program, a string with two news headlines is given, and the sub-strings "iPad" and "Huawei” are searched for, having...

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
ADVERTISEMENT