18.09.2019
Posted by 
C Programs Asked In Tcs Interview Average ratng: 8,6/10 3798 reviews

TCS C/C++ Questions 1. Write any small program that will compile in 'C' but not in 'C++'. This was a question asked to my friend for his interview. Placement Papers - TCS. What is the output of the following program main (). Tata Consultancy Services Interview Experience - Mumbai.

  1. Tcs Interview Questions For Freshers
  2. C Interview Programs

1.Difference between 'C structure' and 'C structure'. 2.Diffrence between a 'assignment operator' and a 'copy constructor' 3.What is the difference between 'overloading' and 'overridding'?

4.Explain the need for 'Virtual Destructor'. 5.Can we have 'Virtual Constructors'? 6.What are the different types of polymorphism?

Nov 06, 2008 Galactic Civilizations II 2.0 Released! I'm a EU user, but Impulse cannot detect the v2.0 patch for Galactic Civilizations II. Galactic Civilizations III Update 2.0 Patch Notes Starbase Administrators: Starbases are under new management. Each Starbase now requires an Administrator to run it. Galactic civilizations 2 mods.

7.What are Virtual Functions? How to implement virtual functions in 'C' 8.What are the different types of Storage classes? 9.What is Namespace? 10.What are the types of STL containers?

11.Difference between 'vector' and 'array'? 12.How to write a program such that it will delete itself after exectution?

13.Can we generate a C source code from the binary file? 14.What are inline functions? 15.What is 'strstream'? 16.Explain 'passing by value', 'passing by pointer' and 'passing by reference' 17.Have you heard of 'mutable' keyword? 18.What is a 'RTTI'? 19.Is there something that I can do in C and not in C?

Tcs interview questions for experienced

20.What is the difference between 'calloc' and 'malloc'? 21.What will happen if I allocate memory using 'new' and free it using 'free' or allocate using 'calloc' and free it using 'delete'? 22.Difference between 'printf' and 'sprintf'. 23.What is 'map' in STL?

24.When shall I use Multiple Inheritance? 25.Explain working of printf.

26.Talk sometiming about profiling? 27.How many lines of code you have written for a single program? 28.How to write Multithreaded applications using C? 29.Write any small program that will compile in 'C' but not in 'C' 30.What is Memory Alignment? 31.Why preincrement operator is faster than postincrement?

32.What are the techniques you use for debugging? 33.How to reduce a final size of executable? 34.Give 2 examples of a code optimization. Editorial / Best Answer Answered by: Rajini.

Feb 19th, 2007 Q. Difference between 'C structure' and 'C structure'.

Ans:- C structure cannot have member functions but C structure can have. Also in a C structure by default all data members of structure are public and access cannot be changed by specifying the private or protected keywords but in C eventhough by default members are public we may change the access using the keywords private and protected. What is the difference between 'overloading' and 'overridding'? Ans:- Overloading is a process of having the same function name but different no of arguments or types of arguments within the same class but overriding means redefining a baseclass functions definition in the subclass. Explain the need for 'Virtual Destructor'. Ans:=Virtual destructor ensures destruction of subclass and base class objects in proper order.

What are the different types of polymorphism? Ans:-Overloading and overriding. What are the different types of Storage classes? Ans:-Auto,Register,static and extern Q.

What is the difference between 'calloc' and 'malloc'? Ans:- calloc and malloc are used for dynamic memory allocation. Calloc initializes the memory locations to zero by default but malloc memory contains garbage values. Difference between 'printf' and 'sprintf'. Printf will write to the console. Sprintf will write to the buffer.

Difference between 'C structure' and 'C structure'. Ans:- C structure cannot have member functions but C structure can have. Also in a C structure by default all data members of structure are public and access cannot be changed by specifying the private or protected keywords but in C eventhough by default members are public we may change the access using the keywords private and protected. What is the difference between 'overloading' and 'overridding'? Ans:- Overloading is a process of having the same function name but different no of arguments or types of arguments within the same class but overriding means redefining a baseclass functions definition in the subclass.

Explain the need for 'Virtual Destructor'. Ans:=Virtual destructor ensures destruction of subclass and base class objects in proper order. What are the different types of polymorphism? Ans:-Overloading and overriding.

Tcs Interview Questions For Freshers

What are the different types of Storage classes? Ans:-Auto,Register,static and extern Q. What is the difference between 'calloc' and 'malloc'? Ans:- calloc and malloc are used for dynamic memory allocation. Calloc initializes the memory locations to zero by default but malloc memory contains garbage values. Difference between 'printf' and 'sprintf'. Printf will write to the console.

C Interview Programs

Sprintf will write to the buffer. Assignment Operator is an operator which simply assign the value of right hand side object to left hand side object. Like int a=3; int b=a; then the value of b will be 3 But in case of array and objects say if we have two objects C1 and C2 then C1=C2 will copy the address of C2 into C1 thus we can access the same memory location with the other name. But in case of Copy Constructor it creates the new object and copy the values of all element in the previous object to the new object or we can say to the new memory location. Note if we use assignment operator at the time of declaring an object it behaves like a copy constructor.

Say object C1= C2 it will call copy constructor implicitly.