C- Functions Question and Answer
C- Functions Question and Answer
1. The keyword used to transfer control from a function back to the calling function is
- switch
- goto
- go back
- return
2. What is the notation for following functions?
int f(int a, float b) { /* Some code */ }
int f(a, b) int a; float b; { /* Some code */ }
int f(int a, float b) { /* Some code */ }
int f(a, b) int a; float b; { /* Some code */ }
- 1. KR Notation 2. ANSI Notation
- 1. Pre ANSI C Notation 2. KR Notation
- 1. ANSI Notation 2. KR Notation
- 1. ANSI Notation 2. Pre ANSI Notation
3. How many times the program will print "IndiaBIX" ?
#include<stdio.h>
int main()
{
printf("IndiaBIX");
main();
return 0;
}
#include<stdio.h>
int main()
{
printf("IndiaBIX");
main();
return 0;
}
- Infinite times
- 32767 times
- 65535 times
- Till stack doesn't overflow
4. The program execution starts from
- the function which is first defined
- main ( ) function
- the function which is last defined
- the function other than main ( )
5. How many main ( ) functions can be defined in a C program ?
- 1
- 2
- 3
- any number of times
6. A function is identified by an open arenthesis following
- a keyword
- an identifier other than keywords
- an identifier including keywords
- an operator
7. A function with no action
- is an invalid function
- produces syntax error
- is allowed and is known as dummy function
- returns zero
8. Parameters are used
- to return values from the called function
- to spend values from the calling function
- options a and b
- to specify the data type of the return value
9. Identify the correct statement.
- A function can be defined more than once in a program
- Function definition cannot appear in any order.
- Functions cannot be distributed in many files.
- One function cannot be defined within another function definition .