TCS Programming MCQ Questions And Answers - TCS
TCS Technical MCQ Questions: This section focuses on "Technical Questions" of TCS Exam. These programming MCQs are asked in previous TCS NQT Exams and will help you to prepare for upcoming TCS NQT exam.
1. A data type is stored as a 6 bit signed integer. Which of the following cannot be represented by this data type?
Explanation: 2^6 = 64. So you can represent 64 values. This means 0 to 63 for unsigned integer and -32 to 31 for signed integer (twos complement).
2. What is the difference between a function and a method?
Explanation: A function is a piece of code that is called by name. It can be passed data to operate on and can optionally return data. All data that is passed to a function is explicitly passed.
3. What will be output for the following code?
case 5 :printf(""I am 5"");
case 7: printf(""I am not 5"");
default:printf(""I am different"");
Explanation: This program will generate an error as the break statement does not end with an semi-colon in case 5.
4. The value of EOF is _____
Explanation: The value of EOF = -1;
5. An array is also known as ___________ ?
Explanation: All elements refer to the same name.That is each element can be identified with the same name including different index value(subscript value). Hence,an array is also called as a Subscripted variable.
6. What is the output of this C code?
Explanation: Since i is declared as static variable and the default value is zero for static variables.
7. Which of this is used to skip one iteration?
Explanation: Continue is used to skip current block of statements for one iteration and to jump to the beginning of the loop for condition checking so that it can begin next iteration. Break however is to exit from the loop and directly go to the end of the loop.
8. Which has the highest precision?
Explanation: double has the highest precision.
9. How can we insert different type of data in the stack.
Explanation: Union and structure are the special data type that allows to store different data types in the same memory
10. Which of the following is not a valid type of polymorphism ?
Explanation: Imperative polymorphism is not an valid type of polymorphism.