Principles Of Programming Languages Set 3

On This Page

This set of Principles of Programming Languages Multiple Choice Questions & Answers (MCQs) focuses on Principles Of Programming Languages Set 3

Q1 | What will be the output of the following code? #include using namespace std; int main() { float a='a'; cout<
  • a
  • 0.0
  • 97
  • syntax error
Q2 | What will be the output of the following code?int main() { char ch; ch=129; printf("%d\n",ch); return 0; }
  • 129
  • -129
  • -127
  • syntax error
Q3 | When the type conversion is required?
  • the value to be stored is in the form not supported by data type
  • the value supported is beyond the max limit
  • to reduce the memory in use associated with that value
  • all of these
Q4 | 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; }
  • 2.2
  • 2
  • conversion from double to int is not possible
Q5 | #include using namespace std; int main() { int a=10,b=20; a=a++; b=++b; cout <
  • 10 20
  • 11 20
  • 10 21
  • 11 21
Q6 | 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 _____________.
  • type compatibility
  • type equivalence
  • type conformance
  • all of these
Q7 | What is strong type system?
  • the type system in which only built-in data types are allowed.
  • the type system in which only user defined data types are allowed.
  • the type system that guarantees not to generate type errors.
  • none of these
Q8 | chosse the incorrect statement
  • int a[]=new int[10]
  • int[] a=new int[10]
  • int a[]=int[10] new
  • all of these
Q9 | which of the following is not data type in pascal?
  • real
  • float
  • double
  • struct
Q10 | during implicit conversion is it possible to
  • loss of information
  • sign can be lost
  • occure overlow
  • all of these
Q11 | For defining interface in java --------- keyword is used?
  • interface
  • inter
  • class_interface
Q12 | which of the not looping statement in c?
  • while
  • until
  • double
  • for
Q13 | following is posted loop?
  • do while
  • for
  • if
  • while
Q14 | choose the correct? I)procedure is a kind of routine that return a value? II)functio is a kind of routine that dose no return any value?
  • only one
  • only two
  • both i&ii
  • none of these
Q15 | exception is throw using the keyword ?
  • thrown
  • throw
  • throws
  • throwing
Q16 | which keyword is use to check exception?
  • thrown
  • try
  • catch
  • exception
Q17 | exception handling is for….
  • handling run time error
  • handling syntax error
  • handling logical error
  • all of these
Q18 | FORTRAN uses______________.
  • static allocation strategy
  • stack allocation strategy
  • heap allocation strategy
  • none of these
Q19 | Execution time languages can be classified are__________.
  • static languages
  • stack-based languages
  • fully dynamic languages
  • all of these
Q20 | call by name parameter passing method is used in___________.
  • c
  • pascal
  • algol
  • none of these
Q21 | copy restore parameter passing method is used in___________.
  • c
  • pascal
  • ada
  • none of these
Q22 | Grammars are capable to describe the structure of ........and independent ........models.
  • language and computational
  • language and lexical
  • language and syntactic
  • none of above.
Q23 | The language syntax is characterized by two arrangements of rules: ....... and.........
  • logical and syantax
  • lexical and syntactic
  • lexical and symmetric
  • none of these
Q24 | The distinctin among ......and......standards is to same degree Subjective.
  • logical and syantax
  • lexical and symmetric
  • lexical and syntactic
  • none of these
Q25 | ........give another method for characterizing structure of Programming language.
  • syntax diagrams.
  • axiomatic and denotational approach.
  • context free grammar
  • all of these.