Popular Posts
View All Technical Questions
Q. No. : 1
Question : Consider the following code fragment and select the correct option main()
{int x,c,a=10,b=20;
c=a * b ++;
x=a*b;
printf("%d%d%d",c,x,10<=11);
}
A : 200, 210, 1
B : 200, 200, 1
C : 210, 210, cannot be compare
D : Error due to "10<=11"
Answer: A
Solution
Q. No. : 2
Question: The expression 4+6/3*2-2+7%3 evaluates to
A : 3
B : 4
C : 6
D : 7
Answer: D
Q. No. : 3
Question: A pointer variable can not be
A : passed to a function as arguement
B : changed within a function
C : returned by a function
D : assigned an integer value
Answer: D
Q. No. : 4
Question :
main()
{
inc(); inc(); inc();
}
inc(){
static int x;
printf("%d",++x);
}
A : prints 012
B : prints 123
C : prints 3 consecutive , but unpredictable number
D : prints 111
Answer: B
Q. No. : 5
Question :
main()
{
char str[7]="Strings";
printf("%s",str);
}
A : Error
B : Strings
C : Cannot Predict
D : None of the above
Answer: C
Q. No. : 6
Question :
int i=10;
void main()
{
int i=20;
{
int i=30;
cout << i <<::i strong="">
}
}
A : prints 3010
B : prints 3020
C : will result in a run time error
D : none of the above
Answer: A
Q. No. : 7
Question : Consider the following program segment static char x[3]="1234";
cout << x;
A complete c++ program with these two statement
A : prints 1234
B : prints 123
C : prints 1234 followed by some junk
D : will give a compilation error
Answer: D
Solution
Q. No. : 8
Question : Overloading is otherwise called as
A : a virtual polymorphism
B : transient polymorphism
C : pseudo polymorphism
D : ad-hoc polymorphism
Answer: D
Q. No. : 9
Question : Copy constructor is invoked when
A : a function returns by value
B : an argument is passed by value
C : a function returns for reference
D : an argument is passed by reference
Answer: A
Q. No. : 10
Question : class dog:public x,public y is an example of
A : multiple inheritance
B : repeated inheritance
C : linear inheritance
D : none of the above
Answer: A
Q. No. : 11
Question : The postfix equivalent of the prefix *+ab-cd is
A : ab+cd-*
B : abcd+-*
C : ab+cd*-
D : ab+-cd*
Answer: A
Q. No. : 12
Question : The maximum degree of any vertex in a simple graph with n vertices is
A : n
B : n-1
C : n+1
D : 2n-1
Answer: B
Q. No. : 13
Question : The number of possible ordered trees with 3 nodes A,B,C is
A : 16
B : 12
C : 6
D : 10
Answer: B
Q. No. : 14
Question : A binary tree has n leaf nodes. The number of nodes of degree 2 in this tree is
A : log2(n)
B : n-1
C : n
D : 2 raised to power n
Answer: B
Q. No. : 15
Question : The number of edges in a regular graph of degree d and n vertices is
A : maximum of n, d
B : n+d
C : nd
D : nd/2
Answer: D
Q. No. : 16
Question : The recurrence relation T(1) = 2 and T(n) = 3T(n/4)+n
has solution T(n) equal to
A : O(n)
B : O(logn)
C : O(n raised to power 3/4)
D : npne of the above
Answer: A
Q. No. : 17
Question : The worst case successful search time for sequential search on n items is
A : n
B : (n-1)/2
C : (n+1)/2
D : log(n)+1
Answer: A
Q. No. : 18
Question : The merging two sorted lists of size m and n into a sorted lists of size m+n , we require comparisions of
A : O(m)
B : O(n)
C : O(m+n)
D : O(log(m)+log(n))
Answer: C
Q. No. : 19
Question : Which of the following sorting algorithm has the worst time complexity of nlog(n)
A : Heap Sort
B : Quick Sort
C : Insertion Sort
D : Selection Sort
Answer: A
- -
CHUYÊN MỤC
  • Google Comment (0)
  • Facebook Comment ()
  • Emotion
  • :))
    :((
    :D
    :(
    :)
    :-)
    ;)
    =))
    :p
    =.=
    ==
    ^_^
    /=he
    :*
    /=r
    /=l
    :v
    /=ok
    /=clap
    (y)
    (yy)
    /=hi
    /=j
    /=hup
    /=hd
    /=hl
    /=hr
    /=s
    <3