Technical Questions asked in SAMSUNG

  1. Which of the following class access protected and private members of other class?
    1. Friend class
    2. Virtual class
    3. Main class
    4. None of these
    Answer:  Option A.
    Thers is more coupling between classes.
  2. What is output of following code fragment?
    int val,res,n=1000;
    val=2000;
    res=n+val>1750?400:200;
    cout<< res;
    1. 200
    2. 400
    3. 800
    4. 100
    Answer: Option  B.
    because the arithmetic operator + has higher precedence than ? : operator thus the condition before ? is taken as (n+val) and (1000+2000) > 1750 is true.
Campus Placement ad
  1. What is a minimal super key in DBMS?
    1. Candidate key
    2. Primary key
    3. Secondary key
    4. None of these
    Answer: Option  A.
    What is the output of following program?
    #include
    struct Pixel{int C,R;};
    void Display (pixel P) {
    cout<< "Col" << P.C << "Row"<< P.R << endl; }
    int main()
    { Pixel X = {40,50},Y,Z;
    Z=X;
    X.C += 10;
    Y=Z;
    Y.C += 10;
    Y.R += 20;
    Z.C -= 15;
    QUESTION
    return 0; }
  2. What is the output if it replace QUESTION with Display(X);
    1. Col 50 Row 70
    2. Col 50 Row 50
    3. Col 70 Row 70
    4. None of these
    Answer: Option  B.
  3. What is the output if it replace QUESTION with Display(Y);
    1. Col 50 Row 70
    2. Col 50 Row 50
    3. Col 70 Row 70
    4. None of these
    Answer:  Option  A.
  4. What is the output if it replace QUESTION with Display(Y);
    1. Col 50 Row 25
    2. Col 25 Row 50
    3. Col 25 Row 25
    4. None of these
    Answer:  Option  B.
Campus Placement ad
Rate Us
Views:9715