Top 150+ Solved Principles of Programming Languages MCQ Questions Answer
Q. What is the role of compiler by templates?
a. probability
b. type-safe
c. code elimination
d. allof these
Q. 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
Q. 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
Q. 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
Q. What will be the output of the following code?int main() { char ch; ch=129; printf("%d\n",ch); return 0; }
a. 129
b. -129
c. -127
d. syntax error
Q. When the type conversion is required?
a. the value to be stored is in the form not supported by data type
b. the value supported is beyond the max limit
c. to reduce the memory in use associated with that value
d. all of these
Q. What is the output of the following code? int main() { double x=1.2; int sum=(int)x + 1; printf("sum=%d",sum); return 0; }
a. 2.2
b. 2
c. 2
d. conversion from double to int is not possible
Q. #include<iostream> using namespace std; int main() { int a=10,b=20; a=a++; b=++b; cout <<a<<b; return 0; }
a. 10 20
b. 11 20
c. 10 21
d. 11 21
Q. A strict type system in which one operand type A is allowed to perform operation with another operand with type B.This feature of type system is called _____________.
a. type compatibility
b. type equivalence
c. type conformance
d. all of these
Q. 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. the type system that guarantees not to generate type errors.
d. none of these
Q. chosse the incorrect statement
a. int a[]=new int[10]
b. int[] a=new int[10]
c. int a[]=int[10] new
d. all of these
Q. during implicit conversion is it possible to
a. loss of information
b. sign can be lost
c. occure overlow
d. all of these