C Programs Asked In Tcs Interview

C Programs Asked In Tcs Interview Rating: 3,6/5 9763votes

C Programs Asked In Tcs Interview' title='C Programs Asked In Tcs Interview' />C Programs Asked In Tcs Interview ProgramsC Programs Asked In Tcs Interview ProcessI work for a client of TCS. So, I have to post as an anonymous coward due to legal reasons. I am quite alarmed by Sambeets response, especially his 5th point. G1. What is Battlestar Galactica Battlestar Galactica premiered on the ABC television network in September 1978. It was one of the most spectacular shows ever. C interview questions and answers. Rule 1.  Assign the priority to the pointer declaration considering precedence and associative according to following table. This operator behaves as bracket operator or function operator. This operator behaves as array subscription operator. This operator behaves as pointer operator not as multiplication operator. Identifier It is not an operator but it is name of pointer variable. You will always find the first priority will be assigned to the name of pointer. Data type It is also not an operator. Data types also includes modifier like signed int, long double etc. You will understand it better by examples 1 How to read following pointer Step 1  and enjoys equal precedence. So rule of associative will decide the priority. Its associative is left to right so first priority goes to. Step 2 Inside the bracket and ptr enjoy equal precedence. From rule of associative right to left first priority goes to ptr and second priority goes to Step. Assign third priority to. ATr5itBjywayXbORQ_5U1euvKvjs1-PNN1FtRdMFQH46MdhRQUkEeuQnRtqZvkIPg=h310' alt='C Programs Asked In Tcs Interview Question' title='C Programs Asked In Tcs Interview Question' />Step. Since data type enjoys least priority so assign fourth priority to char. Now read it following manner ptr is pointer to such one dimensional array of size three which content char type data. How to read following pointer Assign the priority considering precedence and associative. Now read it following manner ptr is pointer to such function whose parameter is int type data and return type is float type data. Rule 2 Assign the priority of each function parameter separately and read it also separately. Understand it through following example. How to read following pointer Assign the priority considering rule of precedence and associative. C Programs Asked In Tcs Interview Card' title='C Programs Asked In Tcs Interview Card' />Now read it following manner ptr is pointer to such function which first parameter is pointer to one dimensional array of size two which contentint type data and second parameter is pointer to such function which parameter is void and return type is int data type and return type is void. How to read following pointer Assign the priority considering rule of precedence and associative. Now read it following manner ptr is pointer to such array of size five which content are pointer to such function which parameter is void and return type is int type data. How to read following pointer Answer Assign the priority considering rule of precedence and associative. Now read it following manner ptr is pointer to function which parameter is int type data and return type is pointer to function which first parameter is pointer to pointer of double data type and second parameter is char type data type and return type ispointer to double data type. How to read following pointerAnswer Assign the priority considering rule of precedence and associative. Now read it following manner ptr is pointer to array of size eight and content of array is pointer to function which first parameter is pointer to character constant and second parameter is variable number of arguments and return type is pointer to pointer of unsigned int data type. TCS Possible Technical Interview Questions for new Campus Recruitment. Interview With TCS The Campus Interview. This interview usually takes 4. One interviewer may focus on your communication skills, self management skills and background by asking behavioral questions. The other will focus on your technical capabilities. The Phone Interview. If TCS not coming to your school this fall, and you have probably submitted your resume online. You look great on paper and they would like to have an employment discussion with candidate. They will set up a mutually convenient date and time for your phone interview. Your interviewer will assess your communication skills, self management skills and background by asking behavioral questions. He she may also assess your technical ability. If the phone interview goes well, you will be asked to join us for an in person interview. TCS Technical interview Questions. What is your strongest programming language Java, ASP, C, C, VB, HTML, C, etc. Point to remember Before interview You should decide your Favorite programming language and be prepared based on that question. Differences between C and JavaJAVA is Object Oriented while C is procedural. Java is an Interpreted language while C is a compiled language. C is a low level language while JAVA is a high level language. C uses the top down approach while JAVA uses the bottom up approach. Pointer go backstage in JAVA while C requires explicit handling of pointers. The Behind the scenes Memory Management with JAVA The User Based Memory Management in C. JAVA supports Method Overloading while C does not support overloading at all. Unlike C, JAVA does not support Preprocessors, does not really them. The standard Input Output Functions C uses the printf scanf functions as its standard input output while JAVA uses the System. System. in. read functions. Exception Handling in JAVA And the errors crashes in C. In header files whether functions are declared or defined Functions are declared within header file. That is function prototypes exist in a header file,not function bodies. They are defined in library lib. What are the different storage classes in C There are four types of storage classes in C. They are extern, register, auto and static. What does static variable mean Static is an access qualifier. If a variable is declared as static inside a function, the scope is limited to the function,but it will exists for the life time of the program. Values will be persisted between successive calls to a function. How do you print an address Use p in printf to print the address. Power Rangers Drinking Game. What are macros what are its advantages and disadvantages Macros are processor directive which will be replaced at compile time. The disadvantage with macros is that they just replace the code they are not function calls. Difference between pass by reference and pass by value Pass by value just passes the value from caller to calling function so the called function cannot modify the values in caller function. But Pass by reference will pass the address to the caller function instead of value if called function requires to modify any value it can directly modify. What is an object Object is a software bundle of variables and related methods. Objects have state and behavior. What is a class Class is a user defined data type in C. It can be created to solve a particular kind of problem. After creation the user need not know the specifics of the working of a class. What is the difference between class and structure Structure Initially in C a structure was used to bundle different type of data types together to perform a particular functionality. But C extended the structure to contain functions also. The major difference is that all declarations inside a structure are by default public. Class Class is a successor of Structure. By default all the members inside the class are private. What is ponter Pointer is a variable in a program is something with a name, the value of which can vary. The way the compiler and linker handles this is that it assigns a specific block of memory within the computer to hold the value of that variable. What is the difference between null and void pointer A Null pointer has the value 0. ANSI. Generic pointer can hold the address of any data type. Function overloadingis a feature of C that allows us to create multiple functions with the same name, so long as they have different parameters. Consider the following function int Addint n. X, int n. Yreturn n. X n. Y 1. 5. What is function overloading and operator overloading Function overloading C enables several functions of the same name to be defined, as long as these functions have different sets of parameters at least as far as their types are concerned. This capability is called function overloading. When an overloaded function is called, the C compiler selects the proper function by examining the number, types and order of the arguments in the call. Function overloading is commonly used to create several functions of the same name that perform similar tasks but on different data types. Operator overloading allows existing C operators to be redefined so that they work on objects of user defined classes. Overloaded operators are syntactic sugar for equivalent function calls. They form a pleasant facade that doesnt add anything fundamental to the language but they can improve understandability and reduce maintenance costs. A friend function for a class is used in object oriented programming to allow access to public, private, or protected data in the class from the outside. Normally, a function that is not a member of a class cannot access such information neither can an external class. Occasionally, such access will be advantageous for the programmer. Under these circumstances, the function or external class can be declared as a friend of the class using the friend keyword. What do you mean by inline functionThe idea behind inline functions is to insert the code of a called function at the point where the function is called. If done carefully, this can improve the applications performance in exchange for increased compile time and possibly but not always an increase in the size of the generated binary executables. Tell me something about abstract classes An abstract class is a class which does not fully represent an object. Instead, it represents a broad range of different classes of objects. However, this representation extends only to the features that those classes of objects have in common. Thus, an abstract class provides only a partial description of its objects. What is the difference between realloc and free The free subroutine frees a block of memory previously allocated by the malloc subroutine. Undefined results occur if the Pointer parameter is not a valid pointer. If the Pointer parameter is a null value, no action will occur. The realloc subroutine changes the size of the block of memory pointed to by the Pointer parameter to the number of bytes specified by the Size parameter and returns a new pointer to the block. The pointer specified by the Pointer parameter must have been created with the malloc, calloc, or realloc subroutines and not been deallocated with the free or realloc subroutines. Undefined results occur if the Pointer parameter is not a valid pointer. What is the difference between an array and a listArray is collection of homogeneous elements.