TCS Papers: Sample Questions 327 - 329 of 502

Examrace Placement Series prepares you for the toughest placement exams to top companies.

Question number: 327

» Languages » C & C Plus Plus

Short Answer Question▾

Write in Short

What is the output of printf (“%d”)?

Explanation

  • When we write printf (“%d”, x will print the value of x.

  • But as here, there is nothing after % d so compiler will show in output window garbage.

  • But if the situation is

  1. main ()
  2. {
  3.     int a=1b=2c=3;
  4.     printf(“%d”);
  5. }

The output will be the value of the last variable, i. e. 3

Question number: 328

» Languages » Java

Essay Question▾

Describe in Detail

How do you instantiate a complex number?

Explanation

Different ways to assign a value to a complex number are:

  • By passing two Double values to its constructor- first value represents the real, and the second value represents imaginary part.

    • For Example: Complex c1 = new Complex (5,8); /* It represents (5,8) */

    • By assigning a Byte, SByte, Intl6, UIntl6, Int32, UInt32, Int64, UInt64, Single, or Double value to a Complex object.

    • The assigned value represents real part, and imaginary part becomes 0.

    • For Example: Complex c2 = 15.8; /* It represents (15.8,0) */

    • By casting a Decimal or BigInteger value to a Complex object.

    • For example, Complex c3= (Complex) 12.8; /* It represents (12.8,0) */

    • Assigning the value returned by an operator to a Complex variable.

  • For example, Complex c4c1 + c2; /* It represents (20.8,8) */

Question number: 329

» Languages » C & C Plus Plus

Essay Question▾

Describe in Detail

What is common Language Specification (CLS)?

Explanation

  • CLS is a set of rules followed by each. NET- compliant language, enabling interoperability between two. NET-compliant languages.

  • CLS is a subset of CTS, therefore, the languages supported by CLS can use each other’s class libraries similar to their own.

  • Application programming interfaces (APIs following the rules in CLS can be used by all. NET-compliant languages.

  • The CLS is a common platform that integrates code and components from multiple. NET programming languages allowing a. NET application to be written in multiple programming languages with no extra work by the developer.

The Common Language Specification (CLS)

The Common Language Specification (CLS)

Given the image is define the Common Language Specification (CLS)