Principles Of Programming Languages Set 2

On This Page

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

Q1 | In C, reference is declared using the symbol
  • *
  • &
  • &&
  • !
Q2 | The default parameter passing method used in C++ is ____________.
  • call by reference
  • call by value
  • call by name
  • none of these
Q3 | The difference between memory and storage is that memory is __________________ and storage is __________.
  • temporary, permanent
  • permanent,temporary
  • slow,fast
  • all of above
Q4 | What is relationship between reliability and failure?
  • direct relation
  • inverse relation
  • no relation
  • varying relationdepending upon the situation
Q5 | Language efficiency can be achieved by ___________.
  • maximum speed
  • less memory consumption
  • reusability
  • all of these
Q6 | Programming language FOTRAN stands for:
  • free translator
  • formula translator
  • formula translation
  • free translation
Q7 | The full form of BNF is_____________.
  • beginning normal form
  • backus naur form
  • best normal form
  • none of these
Q8 | Semantic of a program means-
  • format of a program
  • meaning of a program
  • simply content of a program
  • none of these
Q9 | What is the output of the following code? Int main(void) { char name='P'; 'P'=10;return 0; }
  • name will contain value 10
  • p will contain 10
  • syntax error
  • none of these
Q10 | Which of the following represents correct syntax for function declaration?
  • int sum(int,int);
  • int sum(int,int){}
  • int sum;
  • both a and c
Q11 | During execution of a program the compiler demands for block of memory to operating system.This block is called as _____________.
  • code memory
  • data memory
  • runtime storage
  • none of these
Q12 | What is relationship between reliability and failure?
  • direct relationship
  • inverse relationship
  • no relation
  • varying relation depending upon the situation
Q13 | #include #define count 10; void main() { printf("%d",count); }
  • 10
  • syntax error
  • infinity
  • none of these
Q14 | When variable used in the program is a whole number,then variable is stored as ___________.
  • string data type
  • integer data type
  • negative whole number
  • positive whole number
Q15 | Class is _______.
  • template which associates code and data
  • data abstraction
  • implementation of abstract data type
  • object oriented
Q16 | What will be the output of following code? #include 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; }
  • 0 1 2
  • 1 2 3
  • syntax error
  • none of these
Q17 | What is the output of following code? #include 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<<" "<
  • syntax error
  • 3 4 5 6 7
  • 1 2 3 4 5
  • none of these
Q18 | Which size should be used when double precision is required?
  • float
  • double
  • long double
  • none of these
Q19 | What will be the output of the follwing code? #include using namespace std; int main() { float a=22.22; double b= 22.22; if(a==b) cout<<"Matching"; else cout<<"Not Matching"; return 0; }
  • matching
  • non matching
  • syntax error
  • none of these
Q20 | Explicit type conversion is known as_____.
  • conversion
  • casting
  • separation
  • none of these
Q21 | What is the role of compiler by templates?
  • probability
  • type-safe
  • code elimination
  • allof these
Q22 | A mathematical model with a collection of operations defined on that model is called__________.
  • data structure
  • abstract data type
  • built in data type
  • none of these
Q23 | 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.
  • a type system that guarantees not to generate type errors.
  • none of these
Q24 | Identify the built-in data type__________________.
  • struct
  • class
  • int
  • enum
Q25 | What will happen if null pointer is converted to boolean___________.
  • the boolean value is evaluated to true
  • the boolean value is evaluated to false
  • errror is raised
  • none of these