Technical Questions asked in Visa

  1. What will be output of following program?
    #include
    #include
    int main(){
    register a = 25;
    int far *p;
    p=&a;
    printf("%d ",*p);
    return 0;
    }
    1. 25
    2. 4
    3. Address
    4. Compilation error
    Answer: Option D.
  2. The prefix of (X+Y)*(C-D) is
    1. +- XY*CD
    2. *+-XYCD
    3. +XY-CD
    4. *XY+CD
    Answer: Option C.
techmahindra article ad
  1. What will be output of following program?
    #include
    #include
    int main(){
    char far *p,*q;
    printf("%d %d",sizeof(p),sizeof(q));
    return 0;
    }
    1. 2 2
    2. 4 4
    3. 4 2
    4. 2 4
    Answer: Option B.
  2. Study the following program written in a block-structured language:
    var x, y : integer;
    procedure P(n:integer);
    begin
    x: = (n + 2) / (n - 3); end;
    procedure Q
    var x, y : integer;
    begin
    x: = 3;
    y: = 4;
    P(y);
    Write (x) ...(1)
    end;
    begin
    x: = 7; y: = 8;
    Write (x) ...(2)
    end
    What will be printed by write statements marked (1) and (2) in the program if variables are statically scoped?
    1. 3, 6
    2. 6, 7
    3. 3,7
    4. None of these
    Answer: Option A.
  3. Consider the following program in a language that has dynamic scooping
    var x: real;
    procedure show:
    begin print(x);end;
    procedure small;
    var x: real;
    begin x: = 0.125; show; end;
    begin
    x:=0.25
    show; small
    end.
    Then the output of the program is:
    1. 0.125 0.125
    2. 0.25 0.25
    3. 0.25 0.125
    4. 0.125 0.25
    Answer: Option C.
  4. The value of j at the end of the execution of the following C program ____________
    intincr (int i)
    {
    staticint count = 0;
    count = count + i;
    return (count);
    }
    main () {
    int i, j;
    for (i = 0; i <= 4; i++)
    j = incr (i);
    }
    1. 10
    2. 4
    3. 6
    4. 7
    Answer: Option A.
Campus Placement ad
Rate Us
Views:4615