C Functions MCQ
Q1. Choose correct statement about Functions in C Language.
- A Function is a group of c statements which can be reused any number of times
- Every Function has a return type
- Every Function may no may not return a value
- All the above
Answer:- (D).
Explanations :None
Explanations :None
void main() { printf("Hello"); }
- "main" is the name of default must and should Function
- main() is same as int main()
- By default, return 0 is added as the last statement of a function without specific return type
- All the above
Answer:- (D).
Explanations :None
Explanations :None
- Self Function
- Auto Function
- Recursive Function
- Static Function
Answer:- (C).
Explanations :None
Explanations :None
int **a;;
- switch
- goto
- go back
- return
Answer:- (D).
Explanations :None
Explanations :None
int main() { printf("Algbly"); main(); return 0; }
- Infinite times
- 32767 times
- 65535 times
- Till stack overflows
Answer:- (D).
Explanations :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.
Explanations :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.
void show() { printf("PISTA "; show(); } void main() { printf("CACHEW "); return 10; }
- PISTA CACHEW
- CASHEW PISTA
- PISTA CASHEW with compiler warning
- Compiler error
Answer:- (C).
Explanations :Here show() function should not return anything. So, return 10; is not recommended.
Explanations :Here show() function should not return anything. So, return 10; is not recommended.
- Library Functions
- User Defined Functions
- Both Library and User Defined
- None of the above
Answer:- (C).
Explanations :No explanation is given for this question.
Explanations :No explanation is given for this question.
- Pass By Value copies the variable value in one more memory location
- Pass By Value protects your source or original variables from changes in outside functions or called functions
- All the above
Answer:- (D).
Explanations :No explanation is given for this question.
Explanations :No explanation is given for this question.
- 16
- 31
- 32
- No Limit
Answer:- (D).
Explanations :None
Explanations :None
- printf()
- show()
- scanf()
- main()
Answer:- (D).
Explanations :main() is a compulsory function with or without returning anything.
Explanations :main() is a compulsory function with or without returning anything.
Copyright © 2022 Shineskill Software Pvt. Ltd., All rights reserved.