TCS Placement: Sample Questions 399 - 400 of 502

Get unlimited access to the best preparation resource for competitive exams : get questions, notes, tests, video lectures and more- for all subjects of your exam.

Question 399

Edit

Write in Short

Short Answer▾

Can static variables are declared in a header file?

Explanation

  • You can՚t declare a static variable without defining it as well.
  • This is because the storage class modifiers static and extern are mutually exclusive.
  • A static variable can be defined in a header file, but this would cause each source file that included the header file to have its own private copy of the variable, which is probably not what was intended.
  • The static variables don՚t have external linkage which means they cannot be accessed outside the translation unit in which they are being defined.

Question 400

Edit

Describe in Detail

Essay▾

Name of the classes that are introduced in the System. Numerics namespace.

Explanation

  • The following two new classes are introduced in the System. Numerics namespace.
  • BigInteger -
    • Non-primitive integral type to hold a value of any size.
    • No lower and upper limit allowing arithmetic calculations with very large numbers which cannot be held by double or long.
    • Complex -
  • Represents complex numbers enabling arithmetic operations with complex numbers.
  • Complex number is represented in the form a + bi, where a is the real part and b is the imaginary part.

Developed by: