OBJECTIVE QUESTIONS: Choose the correct alternative: 1. Function is data type a) Primary b) user defined c) derived d) none 2. The declaration of function is called a) function prototype b) function call c) function definition d) function creation 3. Which storage class will lead to faster execution? a) static b) automatic c) register d)extern 4. If local & global variable have the same name,then a) local variable have more precedence than global variable. b) global variable have more precedence than local variable. c) local &global variable have same d) none 5. Array is of a) Scalar type b) Aggregate type c) Union type d) Enumerated type 6. Array name is a a) Variable b) Pointer to constant c) Constant pointer d) Constant 7. Which of the following is true about array? a) Array elements are stored in contiguous memory locations b) In c arrays are stored in row-major order c) An array can be declared as local as well as global d) All the above 8. Which of the following correctly declares an array? a) int anarray[10]; b) int anarray; c) anarray{10}; d) array anarray[10]; 9. Main() is function a)user defined b) library c) primary d) keyword 10. A function calling itself is a) primary function b) recursive function c) non-recursive function d) iterative function 11. Which of the following statement is false a)functions facilities top-down modular programming b) functions increases the length of program c)it is easy to locate & isolate faulty functions d) functions are derived data types. 12. In c language, function call would be on left-hand side of assignment statement. a) yes b) no c) can t say d) none
13. main() function has arguments a) yes b) no c) can t say d) none 14. Nesting of functions is a) function calling other function b) function calling itself. c) Function definition inside another function definition d) a & b 15. Which storage class retains the value across different function calls? a) static b) automatic c) register d)extern 16. Which is default storage class? a) static b) automatic c) register d)extern 17. Extern declaration doesn t allocate storage space for variables. a) yes b) no c) can t say d) none 18. Default initial value is 0 in a) auto b) register c) extern d) none 19. Which of these is the correct form of function definition? a) int func(a,b) {int a,b;..} b) int func(int a,b) {.} c) int func(a,b) int a,int b{.} d) int func(a,b) int a,b;{.} 20. Which of the following is a two-dimensional array? a) array anarray[20][20]; b) int anarray[20][20]; c) int array[20, 20]; d) char array[20]; 21. What is the index number of the last element of an array with 29 elements? a) 29 b) 28 c) 0 d) Programmer-defined 22. When an argument is passed by reference, the of data is passed to the function. a) copy b) address c) value d) none. 23. int i; main(){ printf( %d,i); i++; Val(); printf( %d,i); Val();} Val(){ i=100; printf( %d,i); i++;} a) 0 100 101 101 b) 0 100 101 101 100 c) 0 100 100 101 d) garbage values
24. main(){ static int c=s; printf( %d,c--); if(c) main();} a) 5 4 3 2 1 b) infinite loop c) error d) none 25. When a function is recursively called,all automatic variables a) are initialized during each execution of function b) are retained from the last execution c) are maintained in stack d) none 26. Use of macro in the place of functions a) reduces execution time b) reduced code size c) increases execution time d) none 27. #define disp(x) printf( x ); main(){ disp( hello );} output is: a) hello b) hello c) x d) none of these 28. main() { printf( %d, printf( %c,0); } a) 1 b) 0 1 c) 0 0 d) 1 0 29. Which of the following is not a function of ctype.h? a) isalpha() b) islower() c) isspace() d) none of these 30. Which of the following is not a part of a function header? a) name b) parameter list c) return type d) title 31. By default the function returns a) integer value b) float value c) char value d) none 32. The meaning of keyword void before the function name means a) function should not return any value b) function should return any value c) no arguments are passed d) none 33. If the CPU fails to keep the variable in CPU register in that case the variables are assumed
a) automatic b) static c) external d) none 34. C preprocessor a) takes care of conditional compilation b) takes care of macro c) takes care of include files d) acts before compilation 35. A preprocessor command a) need not start on a new line b) need not start on the first column c) has # as the first character d) comes before the first executable statement. 36. The order in which actual parameters are evaluated in a function call a) is from the left b) is from the right c) is compiler dependent d) none 37. The default parameter passing mechanism is a) call by value b)call by reference c)call by value reference d)none 38. The function that returns the absolute value of a long integer is a) abs b) dabs c)fabs d)labs 39. main() { int a=2,b=10; printf( %d,mul(mul(a,b),b)); } mul(int x,int y); { return (x*y); } a)garbage value b)error c)20 d)200 40. Variables declared using storage class are not local type. a) auto b) register c) static d)extern 41. Calling function sends arguments to called function. a)formal b) actual c) static d)external 42. If you don t initialize a static array, what would be the elements set to? a) 0 b) an known value c) 1 d) the character constant \0 43. 2. The amount of storage required for holding elements of the array depends on a) size b) data type c) data type & size d) Runtime requirement 44. How many values a function can return at a time a) 2 b) any number of values c) only 1 d) no values 0 45. In which parameter passing mechanism, actual argument values are unchanged? a) By value b) by value reference
c) by name d) by reference 46. Which of the following is wrong with respect to functions a) it facilitates the top-down modular programming b) function will provide reusability of the code c) a function will always return some value d) reduce the length of the program 47. Which one of the following indicates that the function returns nothing a) main() b) void () c) function() d) All 48. What is the Standard Header File for the function abs() a) ctype.h b) stdlib.h c) math.h d) None 49. Function prototype scope is Used for identifiers in [ ] a) parameter list b) Blocks c) Arrays d)all 50. Communicating information between functions is possible from a) modules b) Parameters c) variables d) None 51. What is the Standard Header File for the function tolower() a) stdlib.h b) string.h c) ctype.h d) stdio.h 52. Where do you get more Performance [ ] a) Iteration b) Recursion c) Both A&B d) None 53. Which of the following is not an advantage of functions in C? a) Understandable and manageable b) Reusability of Code c) protect data d) Data binding 54. If a static array is not initialized, then its elements are set to a) zero b) a float number c) an undetermined value d) character constant 55. Array elements are stored in memory locations. a) direct b) sequential c) scattered d) random 56. Which of the following statement is wrong with respect to a storage class? a) It specifies the default initial value b) It specifies the life of a variable c) By default a storage class is static d) It specifies where the variable is stored Fill in the blanks: 1. When an argument is passed by reference, the of data is passed to the function. 2. Array symbol is 3. Default initial value is 0 in variable or storage class 4. Main() is function 5. is default storage class 6. function calling itself is 7. int a[2][3] is dimensional array declaration. 8. In char x[10] number of characters will be stored maximum. 9. In call by value parameter passing is
10. In call by reference parameter passing is 11. In Char a[2][3][2] declaration number of characters will be stored maximum 12. The parameters in a function definition are called as parameters 13. The array elements always stored in memory locations 14. Find out pow(2.5,3) = 15. An unspecified return-value-type is always assumed by the compiler to be 16. All functions return data type double 17. The technique used to pass data to a function is known as. 18. The allows us to control the compilation process by including or excluding statements. 19. The qualifier tells the computer that an object value may be changed by entities other than the program. 20. The length of the following array byte[ ] data = { 12,34,9,0,-62,88}is.