[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.46K

Tot. Mock Test: 40


Total Qs: 652+

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

491 / 652

What will be output of following c program?
#include<stdio.h>
int main(){
int i=0;
for(i=0;i<20;i++){
switch(i){
case 0:i+=5;
case 1:i+=2;
case 5:i+=5;
default: i+=4; break;
}
printf("%d ",i);
}
return 0;
}

A0 5 9 13 17

B5 9 13 17

C12 17 22

D16 21

ESyntax error

Answer: Option D

Explanation:

Here is no explanation for this answer

Submit Your Solution

Tags: TCS

NA
SHSTTON
5
Solv. Corr.
14
Solv. In. Corr.
19
Attempted
0 M:0 S
Avg. Time

492 / 652

What will be output of following c program?
#include<stdio.h>
int main(){
enum number { a=-1, b= 4,c,d,e};
printf("%d",e);
return 0;
}

A1

B3

C5

D7

E9

Answer: Option D

Explanation:

Here is no explanation for this answer

Submit Your Solution

Tags: TCS

NA
SHSTTON
5
Solv. Corr.
26
Solv. In. Corr.
31
Attempted
0 M:0 S
Avg. Time

493 / 652

What will be output of following c program?
#include<stdio.h>
auto int tcs(int);
int main(){
    int a=5;
    a=tcs(a);
    printf("%d",a);
    return 0;
}
auto int tcs(int x){
    return x++;
}

ACompilation error

B6

C5

DNone of the above

Answer: Option A

Explanation:

Storage classes allowed with return type are static, extern, typedef.
=> auto and register storage class with the return type of any function

Submit Your Solution

Tags: TCS

NA
SHSTTON
78
Solv. Corr.
195
Solv. In. Corr.
273
Attempted
0 M:0 S
Avg. Time

494 / 652

What is the output of the following 'C' program ?
#include<stdio.h>
long unsigned static const ddlg(){
    static const long unsigned a=0101;
    return a;
}
int main(){
    long number;
    number=ddlg();
    printf("%X",number);
    return 0;
}

A41

B43

CCompilation error

DNone of the above

Answer: Option A

Explanation:

Here is no explanation for this answer

Submit Your Solution

Tags: TCS

NA
SHSTTON
23
Solv. Corr.
13
Solv. In. Corr.
36
Attempted
0 M:0 S
Avg. Time

495 / 652

Choose the correct option.

User defined data types are:


Astructure

Bunion

Carray

Dfunction

EBoth A and B

Answer: Option E

Explanation:

User defined data types are: structure, union, enum

Submit Your Solution

Tags: TCS

NA
SHSTTON
20
Solv. Corr.
15
Solv. In. Corr.
35
Attempted
0 M:0 S
Avg. Time

496 / 652

Choose the correct option.

Derived data types are:


Aarray

Bdouble

Cfunction

Denum

EBoth A and C

Answer: Option E

Explanation:

Derived data types are: array, function, pointer

Submit Your Solution

Tags: TCS

NA
SHSTTON
3
Solv. Corr.
16
Solv. In. Corr.
19
Attempted
0 M:0 S
Avg. Time

497 / 652

What will be output of following c program?
#include <stdio.h>
void print(char *p);
int main()
{
char s[] = "T.C.S", *A;
print(s);
return 0;
}
void print(char *p)
{
while (*p != '\0')
{
if (*p != '.')
printf ("%s", *p);
p++;
}
}

ATCS

BT.C.S

CSegmentation fault

DNone of the above

Answer: Option C

Explanation:

Here is no explanation for this answer

Submit Your Solution

Tags: TCS

NA
SHSTTON
26
Solv. Corr.
77
Solv. In. Corr.
103
Attempted
0 M:7 S
Avg. Time

498 / 652

What will be output of following c program?
#include<stdio.h>
int main(){
char c=-64;
int i=-32;
unsigned int u =-16;
if(c>i){
printf("pass1");
if(c<i)
printf("pass2");
else
printf("Fail2");
}
else
printf("Fail1”);

if(c==i)
printf("pass2");
else
printf("Fail2");
return 0;
}

APass1Pass2

BPass1Fail2

CFail1Pass2

DFail1Fail2

ENone of these

Answer: Option D

Explanation:

Here is no explanation for this answer

Submit Your Solution

Tags: TCS

NA
SHSTTON
10
Solv. Corr.
9
Solv. In. Corr.
19
Attempted
0 M:0 S
Avg. Time

499 / 652

What will be output of following c program?
extern int s;
int t;
static int u;
main ()
{
}

Which of s, t and u are available to a function present in another file.

Aonly s

Bs & t

Cs, t, u

DNone of the above

Answer: Option A

Explanation:

Here is no explanation for this answer

Submit Your Solution

Tags: TCS

NA
SHSTTON
12
Solv. Corr.
31
Solv. In. Corr.
43
Attempted
0 M:0 S
Avg. Time

500 / 652

Choose the correct option.
main ()
{
}
int a;
f1(){}
f2(){}

Which of the functions is int a available for?

AAll of them

Bonly f2

Conly f1

Df1 and f2 only

Answer: Option D

Explanation:

Here is no explanation for this answer

Submit Your Solution

Tags: TCS


Here is the list of questions asked in TCS Aptitude Test Question with Answers page 50. 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