Presentation is loading. Please wait.

Presentation is loading. Please wait.

QUIZ.

Similar presentations


Presentation on theme: "QUIZ."— Presentation transcript:

1 QUIZ

2 QUESTION 1: What will happen in this code?     int a = 100, b = 200;     int *p = &a, *q = &b;     p = q; a) b is assigned to a b) p now points to b c) a is assigned to b d) q now points to a

3 QUESTION 2: int main() { char *ptr; char Str[] = "abcdefg"; ptr = Str; ptr += 5; cout << ptr; return 0;} a) fg b) cdef c) defg d) abcd

4 QUESTION :3 The operator used for dereferencing or indirection is ____ a) * b) & c) -> d) –>>

5 QUESTION :4 Which of the following accesses the seventh element stored in array? a) array[6]; b) array[7]; c) array(7); d) array;

6 QUESTION :5 What will happen when the structure is declared? a) it will not allocate any memory b) it will allocate the memory c) it will be declared and initialized d) none of the mentioned

7 QUESTION :6 The declaration of structure is also called as? a) sructure creator b) structure signifier c) structure specifier d) none of the mentioned

8 QUESTION :7 Identify the correct option. a) enumerators are contants b) enumerators are user defined types c) enumerators are unchangables. d) character

9 QUESTION 8 int main() { int i;
enum month {JAN = 1, FEB, MAR, APR, MAY, JUN, JUL, AUG, SEP, OCT, NOV, DEC}; for (i = MAR; i <= NOV; i++) cout << i; return 0;} a) b) c) d)

10 QUESTION 9:  Which is used to keep the call by reference value as intact? a) static b) const c) absolute d) none of the mentioned

11 QUESTION 10 WHAT IS VALUE OF X void fun(int &x) {x = 20;} int main() {int x = 10; fun(x); cout << "New value of x is " << x; return 0;} a) 10 b) 20 c) 15 d) none of the mentioned

12 QUESTION:11  Function overloading is also similar to which of the following? a) operator overloading b) constructor overloading c) destructor overloading d) none of the mentioned

13 QUESTION :12 What will happen while using pass by reference a) The values of those variables are passed to the function so that it can manipulate them b) The location of variable in memory is passed to the function so that it can use the same memory area for its processing c) The function declaration should contain ampersand (& in its type declaration) d) All of the mentioned

14 QUESTION:13 Which of the following statement is correct?
A.Overloaded functions can accept same number of arguments. B.Overloaded functions always return value of same data type. C.Overloaded functions can accept only same number and same type of arguments. D.Overloaded functions can accept only different number and different type of arguments.

15 QUESTION 14 Which of the following statement is correct about the program given below? #include<iostream.h> int main() { int x = 10; int &y = x; x = 25; y = 50; cout<< x << " " << --y; return 0; } A.The program will print the output B.It will result in a compile time error. C.The program will print the output D.The program will print the output

16 QUESTION 15: . Which of the following statement is correct?
A.The order of the default argument will be right to left. B.The order of the default argument will be left to right. C.The order of the default argument will be alternate. D.The order of the default argument will be random.


Download ppt "QUIZ."

Similar presentations


Ads by Google