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.

Placement Questions & Answers :: TCS


Not Attempted

501. What will be result of the following program?

#include
#include
int myalloc(char *x, int n){
x= (char *)malloc(n*sizeof(char));
memset(x,\0,n*sizeof(char));
}
int main(){
char *g="String";
myalloc(g,20);
printf("The string is %s",g);
return 0;
}

View Answer | Submit Your Solution | Topic: Dynamic Memory Allocation | Asked In |

Answer: Option B

Explanation:

Here is no explanation for this answer

Submit Your Solution

Tags:

TCS 

Not Attempted

502. What will be the result of the following program?

#include
#include
char *gxxx(){
static char xxx[1024];
return xxx;
}
int main(){
char *g="string";
strcpy(gxxx(),g);
g = gxxx();
strcpy(g,"oldstring");
printf("The string is : %s",gxxx());
return 0;
}

View Answer | Submit Your Solution | Topic: String | Asked In |

Answer: Option B

Explanation:

Here is no explanation for this answer

Submit Your Solution

Tags:

TCS 

Not Attempted

503. In the following code segment what will be the result of the function

#include
int main(){
unsigned int x=-1;
int y;
y = ~0;
if(x == y)
printf("same");
else
printf("not same");
printf("%u %d",x,y);
return 0;
}

View Answer | Submit Your Solution | Topic: Variables & Data Types | Asked In |

Answer: Option A

Explanation:

Here is no explanation for this answer

Submit Your Solution

Tags:

TCS 

Not Attempted

504. 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

View Answer | Submit Your Solution | Topic: Dynamic Memory Allocation | Asked In |

Answer: Option B

Explanation:

Here is no explanation for this answer

Submit Your Solution

Tags:

TCS 

Not Attempted

505. 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;
}

View Answer | Submit Your Solution | Topic: Control Instructions | Asked In |

Answer: Option D

Explanation:

Here is no explanation for this answer

Submit Your Solution

Tags:

TCS 

Not Attempted

506. 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;
}

View Answer | Submit Your Solution | Topic: Variables & Data Types | Asked In |

Answer: Option D

Explanation:

Here is no explanation for this answer

Submit Your Solution

Tags:

TCS 

Not Attempted

507. 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++;
}

View Answer | Submit Your Solution | Topic: Increment-Decrement | Asked In |

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

508. 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;
}

View Answer | Submit Your Solution | Topic: Declarations and Initializations | Asked In |

Answer: Option A

Explanation:

Here is no explanation for this answer

Submit Your Solution

Tags:

TCS 

Not Attempted

509. User defined data types are:

View Answer | Submit Your Solution | Topic: Basic Concepts | Asked In |

Answer: Option E

Explanation:

User defined data types are: structure, union, enum

Submit Your Solution

Tags:

TCS 

Not Attempted

510. Derived data types are:

View Answer | Submit Your Solution | Topic: Basic Concepts | Asked In |

Answer: Option E

Explanation:

Derived data types are: array, function, pointer

Submit Your Solution

Tags:

TCS 

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