Tag: programming languages

Questions Related to programming languages

What the following program is executed?

  1. CompilationFails

  2. Will Throw RunTime Error But Code will get Compiled

  3. Throws Linker Error

  4. All the above statements are invalid


Correct Option: A
  1. call by value

  2. call by reference

  3. call by address

  4. All the Above


Correct Option: B

The member functions of a class can be defined outside the Class using

  1. Extraction Operator

  2. Insertion Operator

  3. Scope resolution operator

  4. None of the Above


Correct Option: C

Which of the following will occur when trying to validate the below code Segment? #define #define // GetSquareOfx function-prototype has the following defn // int GetSquareOfx(int) ; Int main() { int x =5 ; Cout << GetSquareOfx() ; return x ; }

  1. Syntax Error

  2. Linker Error

  3. Runtme Error

  4. No Error, It will be run successfully


Correct Option: B

What will be output if you will execute following c code? #include #include void main() {     int a[]={0,1,2,3,4,5,6,7,8,9,10};     int i=0,num;     num=a[++i+a[++i]]+a[++i];     printf("%d",num); }

  1. 6

  2. 7

  3. 8

  4. 9

  5. CompilationError


Correct Option: D
  1. identifiers

  2. constant variables

  3. floating point variables

  4. mnemonic variables


Correct Option: D