TCS Placement Questions & Answers :: TCS
521 / 652
#include <stdio.h>
void main()
{
int i=10;
printf("%d,%d",++i,++i);
}
A11,12
B12,11
C10,11
D11,10
E12,12
Answer: Option E
Explanation:Here is no explanation for this answer
Submit Your Solution
522 / 652
#include<stdio.h>
void main()
{
int i=10,j=2,k=0,m;
m=++i&&++j&&++k;
printf("%d,%d,%d,%d",i,j,k,m);
}
A11,3,1,1
B11,2,0,1
C11,3,1,0
D10,2,0,1
Answer: Option A
Explanation:m = 11 && 3 && 1 = 1
Submit Your Solution
523 / 652
#include <stdio.h>
void main()
{
int a=10,x=20;a=a++ + 10;
x=x++ + ++a;
printf("%d,%d",a,x);
}
A22,43
B12,21
C10,20
D42,42
E21,41
Answer: Option E
Explanation:a = 10+10 first a is increment to 11 but overwritten by 20
x = 20 + 21 a is incremented first from 20 to 21
Submit Your Solution
524 / 652
#include <stdio.h>
void main()
{
int a=10,x;
x= a-- + ++a;
printf("%d",x);
}
A19
B20
C22
D23
Answer: Option B
Explanation:Here is no explanation for this answer
Submit Your Solution
525 / 652
#include<stdio.h>
main()
{
int x,a=10;
x=9*5+ 7/3 -6+a;
printf("%d",x);
}
A51
B51.5
C31
DNone of these
Answer: Option A
Explanation:45+2-6+10 = 51
7/3 =2 int division
Submit Your Solution
526 / 652
Which among the following operator has the right to left associativity?
AArithmetic
Blogical
CRelational
DIncrement/Decrement
Answer: Option D
Explanation:Here is no explanation for this answer
Submit Your Solution
527 / 652
main()
{
int var=20;
printf("%d,",var);
{
int var=30;
printf("%d",var);
}
}
AError
B20,30
C20,20
DGarbage value
Answer: Option B
Explanation:scope of the local variable is within function or block
Submit Your Solution
528 / 652
#include <stdio.h>
main()
{
int i=-1;
-i;
printf("%d,%d",i,-i);
}
A-1, 1
B-1, -1
C1, 1
D0, 1
Answer: Option A
Explanation:No change in value of i
Submit Your Solution
529 / 652
#include <stdio.h>
main()
{
int a= - - 2;
printf("%d",a);
}
A2
B-2
C1
DError
Answer: Option A
Explanation:Here is no explanation for this answer
Submit Your Solution
530 / 652
Is there any difference between following declarations?
A : extern int fun();
B : int fun();
ABoth are identical
BNo difference, except extern int fun(); is probably in another file
Cint fun(); is overrided with extern int fun();
DNone of these
Answer: Option C
Explanation:Here is no explanation for this answer
Submit Your Solution
Here is the list of questions asked in TCS Aptitude Test Question with Answers page 53. 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