Computer Science Study Materials for Competitive Exams

Sample Questions, Previous Year Solved Papers, Study Materials For Competitive Examinations Like UGC NET, SET And GATE Computer Science.

Thursday, 10 August 2017

C & C++ Programming Multiple Choice Questions - Set 51

1.       What will be the result of the expression 13 & 25?
(A) 38
(B) 25
(C) 9
(D) 12
Answer: C
2.       Which of the following operator can be overloaded through friend function?
(A) ->
(B) =
(C) ( )
(D) *
Answer: D
3.       Which of the following statement is valid?
(A) We can create new C++ operators.
(B) We can change the precedence of the C++ operators.
(C) We can change the associativity of the C++ operators.
(D) We can not change operator templates.
Answer: D
4.       What will be the output of the following program?
#include<iostream.h>
void main()
{
float x=5,y=2;
int result;
result=x % y;
cout<<result;
}
(A) 1
(B) 1.0
(C) Error message
(D) 2.5
Answer: C
5.       Which can be passed as an argument to a function?
(A) constant
(B) expression
(C) another function
(D) all of the above.
Answer: A

6.       While incrementing a pointer, its value gets increased by the length of the data type to which it points. This length is called
(A) scale factor
(B) length factor
(C) pointer factor
(D) increment factor
Answer: D
Explanation:
While incrementing a pointer, its value gets increased by the length of the data type to which it points.
7.       An integer constant in C must have ...................
(A) At least one digit
(B) At least one decimal point
(C) A comma along with digits
(D) Digits separated by commas
Answer: A
8.       A character variable can never store more than ...............
(A) 32 characters
(B) 8 characters
(C) 254 characters
(D) 1 character
Answer: D
9.       RunTime Polymorphism is achieved by .................
(A) friend function
(B) virtual function
(C) operator overloading
(D) function overloading
Answer: B
10.    A function call mechanism that passes arguments to a function by passing a copy of the values of the arguments is ...............
(A) call by name
(B) call by value
(C) call by reference
(D) call by value result
Answer: B

Pages  49   50   51   52   53   54 

No comments:

Post a Comment