TCS NQT 2020 Coding Questions With Answers | TCS NQT Programming Logic Questions

0
22183
TCS NQT 2020 Coding Questions With Answers
TCS NQT 2020 Coding Questions With Answers

TCS NQT 2020 Coding Questions With Answers | TCS NQT Programming Logic Questions

In this article TCS NQT 2020 Coding Questions With Answers you will get all the sample and frequently asked questions, which will help you in attending TCS NQT exam.

TCS NQT 2021 Exam Pattern of TCS Recruitment 2021 for freshers:

Test SectionDuration (in minutes)No of Questions
Verbal Ability3024
Reasoning Ability5030
Numerical Ability4026
Programming Logic1510
Coding452
Total18092

TCS NQT 2020 Coding Questions With Answers

1. What is a linker program?


A. Places the program in the memory for the purpose of execution.
B. Relocates the program to execute from the specific memory area allocated to it.
C. Links the program with other programs needed for its execution.
D. Interfaces the program with the entities generating its input data.

The correct answer is A linker program “links the program with other programs needed for its execution.”

2. Which is NOT a function of a loader?

A. Allocation
B. Translation
C. Relocation
D. Loading

The correct answer is “translation” is not a function of a loader.

3. What happens when you perform a bitwise operation on these numbers?

The result of the expression 4^12 is:

A. 2
B. 4
C. 8
D. 12

The result of the expression 4^12 computes to 8. ^ is the XOR operator. The binary form of 4 is 0100 and that of 12 is 1100. Therefore, 0010 ^ 1100 evaluates to 1000, which is equal to 8 in decimal format.

4. How are data/variables stored inside a computer? The ASCII notation? Truly an important question!
Binary Coding for the letter X is ______________

A. 01011000
B. 00111000
C. 10001000
D. 00010100

The binary coding for the letter X is 01011000. Here, 0101 is the zone whereas 1000 is the digit. The alphabets from P to Z have the zone 0101.

5. The in-order and pre-order traversal of a binary tree is D B E A F C G and A B D E C F G, respectively. The post-order traversal of the binary tree is:


A. D E B F G C A
B. E D B G F C A
C. E D B F G C A
D. D E F G B C A

Below is the given tree.

           A
                         /     \
                       /        \
                     B           C
                    /   \        /  \
                  /      \     /    \
                 D      E   F       G

6. Identify the line number in which the error exists?


# include<stdio.h>
# include<conio.h>
void main()
{
    float a = 100.00;
   {
      auto float a = 250.14;
    {
           auto float b = 325;
          printf(“\n%f %f”, a, b);
          b++;
     }
     a++;
     printf(“\n%f %f”, a, b);
     a++;
  }
 printf(“\n%f”, a);
 }

A. line number 5
B. line number 7
C. line number 9
D. line number 14

The variable ‘b’ is declared in the inner block and is accessed in the outer block. Declare ‘b’ globally to remove the error.

7. Predict the output of this code snippet?


#include <stdio.h>
int main()
{
  int i = 3;
  switch (i)
  {
    case 0+1: printf(“Cyber”);
           break;
    case 1+2: printf(“Tecz”);
            break;
    default: printf(“CyberTecz”);
   }
 return 0;
}

A. Cyber
B. Tecz
C. CyberTecz
D. Compiler error

Expression gets evaluated in cases. The control goes to the second case block after evaluating 1+2 = 3 and “Online” is printed.

8. The value obtained in the function is given back to the main by using ________ keyword?


A. Return
B. Static
C. New
D. Volatile

return” keyword gives a value obtained in a function to the main.

TCS NQT 2020 Coding Questions With Answers | TCS NQT Programming Logic Questions: Click here

For TCS NQT 2021 Interview Questions, English and Programming Set 1: Click here

For TCS NQT 2021 Interview Questions, English and Programming Set 2: Click here

TCS NQT 2021 Aptitude Questions Set: Click here

Technical Interview Questions of TCS: Click here

HR Interview Questions of TCS: Click here

How To Write Resume For Getting Shortlisted In TCS: Click here

If You Want To Get More Daily Such Jobs Updates, Career Advice Then Join the Telegram Group From Given Link And Never Miss Update.

Join Telegram Group of Daily Jobs Updates for 2010-2021 Batch: Click Here

TCS NQT 2020 Programming Logic Coding Questions With Answer: Click here

Why You’re Not Getting Response From Recruiter?: Click here

Top 5 High Salary Jobs in India IT Sector 2020: Click here

How To Get a Job Easily: Professional Advice For Job Seekers: Click here

Cognizant Latest News: Up To 20K+ Employees Will Be Hired: Click here

Jio vs Airtel vs Vodafone- Idea 2 Gb Per Day Data Plan Comparison: Click here

Lenovo Legion Three Gaming Laptops Launched In India: Click here

COVID-19 Live Tracker India & Coronavirus Live Update: Click here

Career Tips for Freshers: Top 7 Hacks To Land Your Target JobClick here

Feel Like Demotivated? Check Out our Motivation For You: Click here

List of Best Sites To Watch Free Movies Online in 2020: Click here

5 Proven Tips For How To Look Beautiful and Attractive: Click here

Home Workouts During The Lockdown For Fitness Freaks: Click here

Google Certification 100,000 Courses For Online Certificates: Click here

LEAVE A REPLY

Please enter your comment!
Please enter your name here