Languages-C & C Plus Plus [TCS Placement]: Sample Questions 109 - 111 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 109

C & C Plus Plus

Question

MCQ▾

Cout is a/an ________.

Choices

Choice (4)

a.

Function

b.

Macro

c.

Object

d.

Operator

Answer

c.

Explanation

  • In most environments, standard output is on screen- C ++ stream object defined to access this standard output is cout. Cout is an object which encapsulates the complexity of outputting to the screen.
  • For formatted output operations, cout is used together with the insertion operator, which is written as << (i.e.. , two “less than” signs) .
Given the Image is Define the Output Using Cout Object

Question 110

C & C Plus Plus
Edit

Write in Short

Short Answer▾

Is this program statement valid? INT = 10.50;

Explanation

  • Assuming that INT is a variable of type float, this statement is valid.
  • Reserved words are express in lowercase, so the C compiler will not interpret “INT” as a reserved word.
Given the Image is Defining the INT is a Variable of Type Float, this Statement is Valid

Question 111

C & C Plus Plus
Edit

Describe in Detail

Essay▾

What is output redirection?

Explanation

  • It is the process of transferring data to an alternative output source other than the display screen.
  • Output redirection allows a program to have its output saved to a file.
  • For example, for program named COMPUTE, typing this on the command line “COMPUTE > DATA” will accept input from the user, perform certain computations, and have the output redirected to a file named DATA, instead of screen.
Given the Image is Defining the Redirecting Input from File

Developed by: