C Programming - Functions
Why should I learn to solve C Programming questions and answers section on "Functions"?
Learn and practise solving C Programming questions and answers section on "Functions" to enhance your skills so that you can clear interviews, competitive examinations, and various entrance tests (CAT, GATE, GRE, MAT, bank exams, railway exams, etc.) with full confidence.
Where can I get the C Programming questions and answers section on "Functions"?
IndiaBIX provides you with numerous C Programming questions and answers based on "Functions" along with fully solved examples and detailed explanations that will be easy to understand.
Where can I get the C Programming section on "Functions" MCQ-type interview questions and answers (objective type, multiple choice)?
Here you can find multiple-choice C Programming questions and answers based on "Functions" for your placement interviews and competitive exams. Objective-type and true-or-false-type questions are given too.
How do I download the C Programming questions and answers section on "Functions" in PDF format?
You can download the C Programming quiz questions and answers section on "Functions" as PDF files or eBooks.
How do I solve C Programming quiz problems based on "Functions"?
You can easily solve C Programming quiz problems based on "Functions" by practising the given exercises, including shortcuts and tricks.
The keyword return is used to transfer control from a function back to the calling function.
Example:
#include<stdio.h>
int add(int, int); /* Function prototype */
int main()
{
int a = 4, b = 3, c;
c = add(a, b);
printf("c = %d\n", c);
return 0;
}
int add(int a, int b)
{
/* returns the value and control back to main() function */
return (a+b);
}
Output:
c = 7
1. int f(int a, float b)
{
/* Some code */
}
2. int f(a, b)
int a; float b;
{
/* Some code */
}
#include<stdio.h>
int main()
{
printf("IndiaBIX");
main();
return 0;
}
A call stack or function stack is used for several related purposes, but the main reason for having one is to keep track of the point to which each active subroutine should return control when it finishes executing.
A stack overflow occurs when too much memory is used on the call stack.
Here function main() is called repeatedly and its return address is stored in the stack. After stack memory is full. It shows stack overflow error.