Note 1

Take Note:

Take a note while surfing.





Note With Ink

Give your Note a Colorful Tag.




Easy to Access

Stay on same information and in Sync wherever you are.

Note 2

Take Note:

Organize your information,It may take Shape.





Think With Ink

Differ your Content by Color.




Easy to Access

Easy to pull up your content from anywhere anytime.

Note 3

Take Note:

Don't Let information to miss,Because it take shape





Note With Ink

Simple an Easy Way to take a note.




Easy to Access

Get the same in next visit.


Please wait...

Placement Questions & Answers :: TCS

Company: TCS

Total Qs: 648+

Website: http://www.tcs.com

Total View: 149.45K


Not Attempted

491. What will the following program do?

#include
#include
#include
int main(){
int i;
char a[]="String";
char *p="New Sring";
char *Temp;
Temp=a;
a=malloc(strlen(p) + 1);
strcpy(a,p); //Line no:9//
p = malloc(strlen(Temp) + 1);
strcpy(p,Temp);
printf("(%s, %s)",a,p);
free(p);
free(a);
return 0;
}

Chose correct option

Answer: Option B

Explanation:

Here is no explanation for this answer

Submit Your Solution

Tags: TCS


Not Attempted

492. What will be output of following c program?

#include
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;
}

Answer: Option D

Explanation:

Here is no explanation for this answer

Submit Your Solution

Tags: TCS

Not Attempted

493. What will be output of following c program?

#include
int main(){
enum number { a=-1, b= 4,c,d,e};
printf("%d",e);
return 0;
}

Answer: Option D

Explanation:

Here is no explanation for this answer

Submit Your Solution

Tags: TCS

Not Attempted

494. What will be output of following c program?

#include
auto int tcs(int);
int main(){
int a=5;
a=tcs(a);
printf("%d",a);
return 0;
}
auto int tcs(int x){
return x++;
}

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

Not Attempted

495. What will be output of following c program?

#include
long unsigned static const ddlg(){
static const long unsigned a=0101;
return a;
}
int main(){
long number;
number=ddlg();
printf("%X",number);
return 0;
}

Answer: Option A

Explanation:

Here is no explanation for this answer

Submit Your Solution

Tags: TCS

Not Attempted

496. User defined data types are:

Answer: Option E

Explanation:

User defined data types are: structure, union, enum

Submit Your Solution

Tags: TCS

Not Attempted

497. Derived data types are:

Answer: Option E

Explanation:

Derived data types are: array, function, pointer

Submit Your Solution

Tags: TCS

Not Attempted

498. What will be output of following c program?

#include
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++;
}
}

Answer: Option C

Explanation:

Here is no explanation for this answer

Submit Your Solution

Tags: TCS

Not Attempted

499. What will be output of following c program?

#include
int main(){
char c=-64;
int i=-32;
unsigned int u =-16;
if(c>i){
printf("pass1");
if(c printf("pass2");
else
printf("Fail2");
}
else
printf("Fail1);

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

Answer: Option D

Explanation:

Here is no explanation for this answer

Submit Your Solution

Tags: TCS

Not Attempted

500. extern int s;
int t;
static int u;
main ()
{
}

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

Answer: Option A

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 TCS Mock Test 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