Technical Questions asked in ITC

  1. What will be the output of the program ?
    #include
    int main()
    {
    union a
    {
    int i;
    char ch[2];
    }
    union a u;
    u.ch[0]=6;
    u.ch[1]=7;
    printf("%d\n", u.i);
    return 0;
    }

    The system will allocate 2 bytes to the array
  1. Write a program to find factorial of a number.
    int main()
    {
    int x,i,fac;
    fac=1;
    printf("input the number whose factorial has to be found");
    scanf("%d", &x);
    for(i=x; i>0,i--)
    {
    fac= fac*i;
    }
    u.i is calculated as
    (6)(7) in binary form which is equal to 1798.
    2+4+256+512+1024=1798
  2. Which of the following is similar to constructor overloading?
    1. Operator overloading
    2. Destructor overloading
    3. Function overloading
    4. None of the above
    Answer: Option  C.
    In function overloading, we will be using the same options availed in constructor overloading.
  3. Which of the following is a branch of polymorphism?
    1. Overloading
    2. Inheritance
    3. Encapsulation
    4. None of these
    Answer: Option  A.
  4. Which of the following is feature of friend classes?
    1. If class A is a friend of class B, class B is not automatically a friend of class A.
    2. If class A is a friend of class B, and class B is a friend of class C, class A is not automatically a friend of class C
    3. None of these
    4. Both (a) and (b)
    Answer: Option  D.
  5. Which of the following access modifiers are not supported by Java?
    1. private
    2. protected
    3. abstract
    4. No-access modifiers
    Answer: Option C

Complete Campus Placement Training Course
Video LecturesOnline TestsE-Books & Assignments

Test Site