Principles of Programming Languages
MCQs [set-2]
26. In C, reference is declared using the symbol
A. *
B. &
C. &&
D. !
Answer: B
27. The default parameter passing method used in C++ is ____________.
A. call by reference
o m
B. call by value
. c
C. call by name
te
D. none of these
a
Answer: B
q M
c
28. The difference between memory and storage is that memory is
M is __________.
__________________ and storage
A. temporary, permanent
B. permanent,temporary
C. slow,fast
D. all of above
Answer: A
29. What is relationship between reliability and failure?
A. direct relation
B. inverse relation
C. no relation
D. varying relationdepending upon the situation
Answer: B
30. Language efficiency can be achieved by ___________.
A. maximum speed
B. less memory consumption
C. reusability
D. all of these
Answer: D
31. Programming language FOTRAN stands for:
A. free translator
B. formula translator
C. formula translation
D. free translation
Answer: B
32. The full form of BNF is_____________.
A. beginning normal form
B. backus naur form
C. best normal form
D. none of these
Answer: B
33. Semantic of a program means-
A. format of a program
B. meaning of a program
C. simply content of a program
D. none of these
Answer: B
34. What is the output of the following code? Int main(void) { char name='P';
'P'=10;return 0; }
A. name will contain value 10
B. p will contain 10
C. syntax error
D. none of these
Answer: C
35. Which of the following represents correct syntax for function declaration?
A. int sum(int,int);
B. int sum(int,int){}
Download more sets at McqMate.com
C. int sum;
D. both a and c
Answer: A
36. During execution of a program the compiler demands for block of memory to
operating system.This block is called as _____________.
A. code memory
B. data memory
C. runtime storage
D. none of these
Answer: C
37. What is relationship between reliability and failure?
A. direct relationship
B. inverse relationship
C. no relation
D. varying relation depending upon the situation
Answer: D
38. #include<stdio.h> #define count 10; void main() { printf("%d",count); }
A. 10
B. syntax error
C. infinity
D. none of these
Answer: B
39. When variable used in the program is a whole number,then variable is stored
as ___________.
A. string data type
B. integer data type
C. negative whole number
D. positive whole number
Answer: B
40. Class is _______.
A. template which associates code and data
B. data abstraction
Download more sets at McqMate.com
C. implementation of abstract data type
D. object oriented
Answer: D
41. What will be the output of following code? #include<iostream> using
namespace std; int main() { enum color{blue,orange,green}; enum
fruit{apple,guava,orange}; int i=0; for(i=blue;i<=green;i++) printf("%d",i); return
0; }
A. 0 1 2
B. 1 2 3
C. syntax error
D. none of these
Answer: C
42. What is the output of following code? #include<iostream> using namespace std;
int main() { int I; enum test{a=1,b,c,d,e,f,g,h}; for(i=c;i<=g;i++) cout<<" "<<I;
return 0; }
A. syntax error
B. 3 4 5 6 7
C. 1 2 3 4 5
D. none of these
Answer: B
43. Which size should be used when double precision is required?
A. float
B. double
C. long double
D. none of these
Answer: B
44. What will be the output of the follwing code? #include<iostream> using
namespace std; int main() { float a=22.22; double b= 22.22; if(a==b)
cout<<"Matching"; else cout<<"Not Matching"; return 0; }
A. matching
B. non matching
C. syntax error
D. none of these
Download more sets at McqMate.com
Answer: B
45. Explicit type conversion is known as_____.
A. conversion
B. casting
C. separation
D. none of these
Answer: B
46. What is the role of compiler by templates?
A. probability
B. type-safe
C. code elimination
D. allof these
Answer: B
47. A mathematical model with a collection of operations defined on that model is
called__________.
A. data structure
B. abstract data type
C. built in data type
D. none of these
Answer: B
48. What is strong type system?
A. the type system in which only built-in data types are allowed.
B. the type system in which only user defined data types are allowed.
C. a type system that guarantees not to generate type errors.
D. none of these
Answer: C
49. Identify the built-in data type__________________.
A. struct
B. class
C. int
D. enum
Answer: C
Download more sets at McqMate.com
50. What will happen if null pointer is converted to boolean___________.
A. the boolean value is evaluated to true
B. the boolean value is evaluated to false
C. errror is raised
D. none of these
Answer: B
Download more sets at McqMate.com