TCS Placement Questions & Answers :: TCS
531 / 652
Which of the following special symbol allowed in a variable name?
A* (asterisk)
B| (pipepne)
C=-(hyphen)
D_ (underscore)
Answer: Option D
Explanation:Here is no explanation for this answer
Submit Your Solution
532 / 652
What are the types of linkages?
AInternal and External
BExternal, Internal and None
CExternal and None
DInternal
Answer: Option B
Explanation:Here is no explanation for this answer
Submit Your Solution
533 / 652
Which of the following statements should be used to obtain a remainder after dividing 3.14 by 2.1?
Arem = 3.14 % 2.1;
Brem = modf(3.14, 2.1);
Crem = fmod(3.14, 2.1);
DRemainder cannot be obtain in floating point division.
Answer: Option C
Explanation:fmod(x,y) - Calculates x modulo y, the remainder of x/y.
This function is the same as the modulus operator. But fmod() performs floating point divisions.
Submit Your Solution
534 / 652
Are the expressions arr and &arr same for an array of 10 integers?
AYes
BNo
Answer: Option B
Explanation:Both mean two different things. arr gives the address of the first int, whereas the &arr gives the address of array of ints.
Submit Your Solution
535 / 652
int fun(int arr[]);
int fun(int arr[2]);
AYes
BNo
Answer: Option B
Explanation:No, both the statements are same. It is the prototype for the function fun() that accepts one integer array as an parameter and returns an integer value.
Submit Your Solution
536 / 652
#include
int main()
{
int a[5] = {5, 1, 15, 20, 25};
int i, j, m;
i = ++a[1];
j = a[1]++;m = a[i++];
printf("%d, %d, %d", i, j, m);
return 0;
}
A2, 1, 15
B1, 2, 5
C3, 2, 15
D2, 3, 20
Answer: Option C
Explanation:Here is no explanation for this answer
Submit Your Solution
537 / 652
In C, if you pass an array as an argument to a function, what actually gets passed?
AValue of elements in array
BFirst element of the array
CBase address of the array
DAddress of the last element of array
Answer: Option C
Explanation:Here is no explanation for this answer
Submit Your Solution
538 / 652
What does the following declaration mean?
int (*ptr)[10];
Aptr is array of pointers to 10 integers
Bptr is a pointer to an array of 10 integers
Cptr is an array of 10 integers
Dptr is an pointer to array
Answer: Option B
Explanation:Here is no explanation for this answer
Submit Your Solution
539 / 652
What will happen if in a C program you assign a value to an array element whose subscript exceeds the size of array?
AThe element will be set to 0.
BThe compiler would report an error.
CThe program may crash if some important data gets overwritten.
DThe array size would appropriately grow.
Answer: Option C
Explanation:Here is no explanation for this answer
Submit Your Solution
540 / 652
Comment on the below while statement
while (0 == 0) { }
AIt has syntax error as there are no statements within braces {}
BIt will run forever
CIt compares 0 with 0 and since they are equal it will exit the loop immediately
DIt has syntax error as the same number is being compared with itself
Answer: Option B
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 54. 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