Languages-C & C Plus Plus (TCS Papers): Sample Questions 1 - 3 of 119

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

Question number: 1

» Languages » C & C Plus Plus

Short Answer Question▾

Write in Short

Can include files be nested?

Explanation

  • Yes.

  • Include files can be nested any number of times.

  • However, same files should not be included twice.

  • Many of today’s popular compilers make up for this difficulty by implementing a concept called precompiled headers, in which all headers and associated dependencies are stored in a precompiled state.

  • Many programmers like to create a custom header file that has #include statements for every header needed for each module. This can help avoid potential problems relating to #include files, such as accidentally omitting a #include file in a module.

Question number: 2

» Languages » C & C Plus Plus

Essay Question▾

Describe in Detail

Can the curly brackets {} be used to enclose a single line of code?

Explanation

  • While curly brackets are mainly used to group several lines of codes, it will still work without error if you used it for a single line.

  • This method organizes codes to make it look clearer, especially in conditional statements.

The main uses of curly braces

The Main Uses of Curly Braces

Given the image define the main uses of curly braces are listed in the examples

Question number: 3

» Languages » C & C Plus Plus

Short Answer Question▾

Write in Short

In C programming, how do you insert quote characters (‘and’) into the output screen?

Explanation

  • This is a problem because quotes are normally part of a printf statement.

  • To insert the quote character as part of the output, use the format specifiers ' (for single quote), and " (for double quote).