You are on page 1of 300
Ql Q2z Which of the following statements is correct (i) A pointer varriable can be assigned the value of another pointer variable not necessary of the same data typo Gi) A pointer variable can be assinged a null value (i) one pointer variable can be subtracted from another provided both pointers point to clement of the same array fa) @,0i) ©) WG) Ga) (c) wa) @ Oi), ‘Which one of the following is a correct function category? (Functions with no arguments and no return values (i) functions with arguments and no retum values (Gi) functions with arguments and return values (@) only (it) () ©, Gi) (c) (ii) and (i) @) @,Gi),Gi) FUNCTIONS AND POINTERS Q3 a4 Which of the following statement is correct? (@ A static variable may be ither an intemal type or an oxternal type, depending on the place of declaration. (i) Internal static, variable are those which are declared inside a function. The scope of internal static variables extend upto the end of the finetions in which they are defined ii) The intemal state variables are. similar to auto variables, except that they remain in existence throughout the remainder of the program and initilize with zero, (@) @ and Gi) (©) (and (ity (©) Gi) and (ui) (@) (Gi), (ap Recursive function are executed in a (a) Last in first out order (b) First in first out order (©) paralled fashion @ all of these Qs Qz The default parameter passing mechanism is (a) call by reference (b) call by value (c) call by value result {d) none of these Which of the following statement is incorrect about function {@ The use of a fimction avoids the need for reduntant programming of the same instructions, (i) The Use of fimctions cnables a programmer to build customized library of frequently used routines or of routines containing system dependent features (ii) Some fimctions, accept information but de not retum anything whereas other functions return multiple values at different times (a) None of (i), (i), (iii) ©) ©, G0, Gi) () @.@) (a) Gi), Gai) “The difference between an access function and utility fonction is (a) Thore is no difference between access fiunction and utility function. {b) An eccess function is 2 public elass member ‘nction that retumns the value of one of the class's data memberss and utility function is a private class member function that 18 used only within the class to perform “technical” tasks, ‘An access function is a public class member function that returns the value of the one of the class's data members aid utility function is a protected class member function, (@ An access function is a private class member fanctions that retums the value of one of the class's data memibers and utility function is a public class member function. Qs ar Q.10 Consider the statements putchar (getchar () ) ; putchar (getchar ()) . If a > is the input, the output will be (a) ab (b) an crror message (0) this can’t be the input (d) none of these Correct way of defining a pointer to the function int*display (int*) is (a) int * (*func_ptr) (int x) : fune_ptt = displav; (b) int(*fune_ptr) int) (func. ptr) Gat) ~ display (int): (e) int(*fane pit) (a) 5 Fane, ptr = display () (@ int*( (*func_ptt) () ; func. pir = display “The most appropriate matching for the following pars Group! ) Group I (A, | Indirect addressing [| Loops B | Immediate Pointers addressing ‘Auto decrement 3, | Constants addressing _| Codes: Bonen Bs. Ari @ 3 - 2 wo 2 3 1 @ to 3 2 @ 3 2 2 Functions and Pornrers Ql Q12 Qi3 Q4 ‘A function's purpose is to print customer data. Which of the following is the best name for this fanetion? (a) last Funetion (). It is the final function called in most programs, and this name identifies the function's timing (b) print Customer ( ). It states the function's purpose and is easy to road (©) print customer data ( ). It states everything the function will do (@) ped.(). It’s short for “print customer data” and takes fow keystrokes Pointers are of (@) integer datatype (b) character datatype (c) unsigned integer datatype (@) none of these, ‘What would he the equivalent pointer expression for referring the array clement [i][)ISII!? @ eet@s drat wH+D ©) (@r)t HH sD (atitjtk+l @) (a +) +) HK) =D Which of the following error will be reported on compiling the program given below? Hinclade int main() 1 int af] = (10, 20, 30, 40, 50}; ants for G= 055 < 5:59) { printf (°%ed\n".*a); at: + retum 0, y (a) Estor (b) Error (©) Error (d) Error “Declaration syntax” Expression syntax’ “Lvalue required” “value required’ Qis Q16 Qi7 finclude “stdio h> void display (int), void show (int, int) int main) { int 1= 10, j = 20, k, dispiay 0. show (4, j): retum 0, 3 void display (int c, { @ printft%od Yad”, cd), 3 void show (int ¢) { printh“%adin”, 3 (a) Error (b) 1020 20 (©) 100 10 (@) None of the above Which of the following functions is more versatile for positioning the file pointer in a file? (a) rewind() {b) fseek() (c) feell() The following, loop for (putchar(c’); putchar() patchar(!); putchar()) outputs (a) a syntax error (b) cartet (c) catrat (d) catratratratrat.

You might also like