[Updated] Goldman Sachs Aptitude Test Questions and Answers
Practice List of TCS Digital Coding Questions !!!
Take 50+ FREE!! Online Data Interpretation Mock test to crack any Exams.

TCS Placement Questions & Answers :: TCS

390.88K

Tot. Mock Test: 40


Total Qs: 652+

NA
SHSTTON
25
Solv. Corr.
33
Solv. In. Corr.
58
Attempted
0 M:0 S
Avg. Time

511 / 652

Predict the output of following code.
#include<stdio.h>
void main()
{
int a=2;
if(a-- , --a, a)
printf("Tom");
else
printf("Jerry");
}

ATom

BJerry

CTom Jerry

DError

Answer: Option B

Explanation:

if(2, 0, 0) last value 0 ?False

Submit Your Solution

Tags: TCS

NA
SHSTTON
103
Solv. Corr.
24
Solv. In. Corr.
127
Attempted
0 M:0 S
Avg. Time

512 / 652

Predict the output of following "C" code:
#include <stdio.h>
main()
{
int a=100,b=300;
if(a>50)
a=200;
b=400;
printf("%d",b);
}

A400

B300

C100

DError

Answer: Option A

Explanation:

No braces, so only one immediate statement is part of if

Submit Your Solution

Tags: TCS

NA
SHSTTON
37
Solv. Corr.
85
Solv. In. Corr.
122
Attempted
0 M:0 S
Avg. Time

513 / 652

Predict the output of following "C" code:
#include <stdio.h>
void main()
{
if(printf("O", printf("Two")))
printf("Face");
else
printf("Focus");
}

AError

BOTwoFace

CHaiFocus

DTwoOFace

EFace

Answer: Option D

Explanation:

prints content of printf statement and takes length of the string for if case execution in this case its 4, So true

Submit Your Solution

Tags: TCS

NA
SHSTTON
17
Solv. Corr.
29
Solv. In. Corr.
46
Attempted
0 M:0 S
Avg. Time

514 / 652

Predict the output of following "C" code:
void main()
{
if( printf(""))
printf("Face");
else
printf("Focus");
}

AError

BFace

C""Focus

DFocus

Answer: Option D

Explanation:

prints content of printf statement and takes length of the string for if case case its 1, So true

Submit Your Solution

Tags: TCS

NA
SHSTTON
78
Solv. Corr.
32
Solv. In. Corr.
110
Attempted
0 M:0 S
Avg. Time

515 / 652

Predict the output of following "C" code:
#include <stdio.h>
void main()
{
if( printf("Hai"))
printf("Face");
else
printf("Focus");
}

AError

BHaiFace

CHaiFocus

DFace

Answer: Option B

Explanation:

prints content of printf statement and takes length of the string for if case execution in this case its 4, So true

Submit Your Solution

Tags: TCS

NA
SHSTTON
67
Solv. Corr.
48
Solv. In. Corr.
115
Attempted
0 M:0 S
Avg. Time

516 / 652

Predict the output of following "C" code:
#include <stdio.h>
void main()
{
if(5,4,3,2,1,0,8,9)
printf("True");
else
printf("False");
}

ATRUE

BFALSE

CTrue False

DError

Answer: Option A

Explanation:

Last value of if will be considered

Submit Your Solution

Tags: TCS

NA
SHSTTON
69
Solv. Corr.
111
Solv. In. Corr.
180
Attempted
0 M:16 S
Avg. Time

517 / 652

Predict the output of following "C" code:
#include <stdio.h>
void main()
{
if(5,4,3,2,1,? 0 ? )
printf("True");
else
printf("False");
}

ATRUE

BFALSE

CTrue False

DError

Answer: Option B

Explanation:

Last value of if will be considered

Submit Your Solution

NA
SHSTTON
8
Solv. Corr.
107
Solv. In. Corr.
115
Attempted
0 M:0 S
Avg. Time

518 / 652

Predict the output of following "C" code:
#include <stdio.h>
void main()
{
if(1)
printf("hai");
else
printf("hello");
}

AError

Bhai

Chello

DNo output

Answer: Option A

Explanation:

If condition will be always

Submit Your Solution

Tags: TCS

NA
SHSTTON
33
Solv. Corr.
79
Solv. In. Corr.
112
Attempted
0 M:0 S
Avg. Time

519 / 652

Predict the output of following "C" code:
#include <stdio.h>
void main()
{
int a,x=2,3,4,5; 
a=1,2,3,4,5;
printf("%d%d",x,a);
}

AError

B5,1

C2,1

D5,5

Answer: Option A

Explanation:

Error because list is not within ( )

Submit Your Solution

Tags: TCS

NA
SHSTTON
20
Solv. Corr.
88
Solv. In. Corr.
108
Attempted
0 M:0 S
Avg. Time

520 / 652

Predict the output of following "C" code:
#include <stdio.h>

void main()
{
int a,x=(2,3,4,5);
a=1,2,3,4,5;
printf("%d,%d",x,a);
}

AError

B5,1

C2,1

D5,5

Answer: Option B

Explanation:

valid statement x = last value in list x = 5 during declaration list should be specified inside ( )
valid; a = 1; first value of the list is assigned to variable

Submit Your Solution

Tags: TCS


Here is the list of questions asked in TCS Aptitude Test Question with Answers page 52. Practice TCS Written Test Papers with Solutions and take Q4Interview TCS Online Test Questions to crack TCS written round test. Overall the level of the TCS Online Assessment Test is moderate. Only those candidates who clear the written exam will qualify for the next round, so practic all the questions here and take all the free tests before going for final selection process of TCS