Languages-C & C Plus Plus [TCS Placement]: Sample Questions 53 - 55 of 119

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 53

C & C Plus Plus
Edit

Write in Short

Short Answer▾

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.     inta=1, b=2, c=3;
  4.     printf(“%d”);
  5. }

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

Question 54

C & C Plus Plus
Edit

Describe in Detail

Essay▾

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.
Given the Image is Define the Common Language Specification (CLS)

Question 55

C & C Plus Plus
Edit

Write in Short

Short Answer▾

Advantages of a macro over a function?

Explanation

  • Program is slightly faster
  • No overhead of a function call and function return.
  • Macro parameters are generic
  • Macro parameters do not have types, so can be used with int, float, double etc. arguments
Given the Image is Define the Advantages of a Macro over a Function

Developed by: