II-228 Programming Concepts
11. A user-defined function cannot call another user-defined function.
12. A user-defined function cannot call a main() function.
13. The scope of local variables is limited to the block in which they are defined.
14. Actual and formal arguments can have same variable name.
15. In call by value, values are passed to formal arguments.
16. In call by address, formal arguments are pointer to actual arguments.
17. A change made in formal arguments can change the value of variable permanently.
18. A function prototype gives information in advance to the compiler.
19. A function can pass arguments to another function.
20. The data type before the function name indicates the type of value the function will return.
21. By default, function returns integer value.
22. When a function calls itself, the process is called recursion.
23. Like variable, functions also have address in the memory.
24. Functions can be invoked using pointers to function.
25. Function prototype is not necessary to match with actual function definition.
Answers
1. True 2. False 3. False 4. False 5. True 6. True 7. True 8. True 9. False
10. False 11. False 12. False 13. True 14. True 15. True 16. True 17. False 18. True
19. True 20. True 21. True 22. True 23. True 24. True 25. False
What is/are the output/s of the following programs?
1.
void main()
{
clrscr();
printf("
India is ");
sub();
getche();
}
sub()
{
printf(" my Country");
}
OUTPUT:
India is my Country
M10_ITL-ESL4791_02_SE_C10.indd 228 12/22/2012 5:01:43 PM