Join Regular Classroom : Visit ClassroomTech

TCS NQT Sample Question Paper | Programming Logic

TCS NQT

TCS NQT Exam Updated Pattern 

923

All the best!

Time Up!


Created on

Programming Logic

Mock NQT Test for Programming Logic

Programming Logic

Questions- 24 Ques

Time- 30 mins

Mock Test is Organised by - Code Window

1 / 10

What will be the output of the following C code?
#include
int main()
{
int i = -3;
int k = i % 2;
printf("%d\n", k);
}

2 / 10

What does the following function do for a given Linked List with the first node as head?
void fun1(struct node* head)
{
if(head == NULL)
return;
fun1(head->next);
printf("%d ", head->data);
}

3 / 10

What will be the output of the following C code on a 32-bit machine?
#include
int main()
{
int x = 10000;
double y = 56;
int *p = &x;
double *q = &y;
printf("p and q are %d and %d", sizeof(p), sizeof(q));
return 0;
}

4 / 10

Consider the following definition in a c programming language.
struct node
{
int data;
struct node * next;
}
typedef struct node NODE;
NODE *ptr;
Which of the following c code is used to create a new node?

5 / 10

What will be the output of the following C function?
#include
int main()
{
reverse(1);
}
void reverse(int i)
{
if (i > 5)
exit(0);
printf("%d\n", i);
return reverse(i++);
}

6 / 10

Consider these functions:
push() : push an element into the stack
pop() : pop the top-of-the-stack element
top() : returns the item stored in top-of-the-stack-node
What will be the output after performing this sequence of operations

push(20);
push(4);
top();
pop();
pop();
pop();
push(5);
top();

7 / 10

What will be the output?
#include
int main() {
// printf() displays the string inside quotation
printf("Hello, World!");
return 0;
}

8 / 10

What will be the output of the following C code?
#include
int main()
{
int a = 10, b = 5, c = 5;
int d;
d = a == (b + c);
printf("%d", d);
}

9 / 10

Consider an implementation of an unsorted singly linked list. Suppose it has its representation with a head pointer only. Given the representation, which of the following operation can be implemented in O(1) time?
i) Insertion at the front of the linked list
ii) Insertion at the end of the linked list
iii) Deletion of the front node of the linked list
iv) Deletion of the last node of the linked list

10 / 10

What differentiates a circular linked list from a normal linked list?

Your score is

The average score is 37%

0%

Mandatory NQT

Verbal Ability

Verbal Ability -24 Questions

Reasoning Ability

Reasoning Ability -30 Questions

Numerical Ability

Numerical Ability -26 Questions

Lorem ipsum dolor sit amet consec tetur.

TCS NQT Exam Rules

Subject NQT

Programming Logic

10 Questions

Hands-On Coding 1

1 Question

Hands-On Coding 2

1 Question

Previous Year TCS NQT Solve

Pages
Recent Posts