Languages [TCS Placement]: Sample Questions 121 - 123 of 131
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 121
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) .
Question 122
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.
Question 123
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.