0% found this document useful (0 votes)
19 views3 pages

Tcs Ninja 7 Text Paper

The TCS test Sampus seasons will have four sections: 1) A quantitative test 2) A verbal test on written English skills 3) A test on proficiency in the C programming language 4) A coding test in C language

Uploaded by

akshar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views3 pages

Tcs Ninja 7 Text Paper

The TCS test Sampus seasons will have four sections: 1) A quantitative test 2) A verbal test on written English skills 3) A test on proficiency in the C programming language 4) A coding test in C language

Uploaded by

akshar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

The TCS test Sampus seasons will have four sections:

1) Section-1 Quantitative Test

2) Section-2 Verbal Test (Test on Written English skills)

3) Section-3 Test on Programming Language Proficiency (based on ‘C’)

4) Section-4 Coding test (C Language)

Question 1: What is wrong in this statement?

scanf(%d,whatnumber);

Answer:

An ampersand '&' symbol must be placed before the variable name whatnumber. Placing &
means whatever integer value is entered by the user is stored at the address of the
variable name. This is a common mistake for programmers, often leading to logical errors.

Question 2: What does the format %10.2 mean when included in a printf statement?

Answer:

This format is used for two things: to set the number of spaces allotted for the output
number and to set the number of decimal places. The number before the decimal point is
for the allotted space, in this case it would allot 10 spaces for the output number. If the
number of space occupied by the output number is less than 10, addition space characters
will be inserted before the actual output number. The number after the decimal point sets
the number of decimal places, in this case, it’s 2 decimal spaces.

Question 3: What are linked list?

Answer:

A linked list is composed of nodes that are connected with another. In C programming,
linked lists are created using pointers. Using linked lists is one efficient way of utilizing
memory for storage.
Question 4: What are binary trees?

Answer:

Binary trees are actually an extension of the concept of linked lists. A binary tree has two
pointers, a left one and a right one. Each side can further branch to form additional nodes,
which each node having two pointers as well.

Question 5: Differences between C and Java?

Answer:

1. JAVA is Object-Oriented while C is procedural.


2. Java is an Interpreted language while C is a compiled language.
3. C is a low-level language while JAVA is a high-level language.
4. C uses the top-down approach while JAVA uses the bottom-up approach.
5. Pointer goes backstage in JAVA while C requires explicit handling of pointers.

Question 6: In header files whether functions are declared or defined?

Answer: Functions are declared within header file. That is function prototypes exist in a
header file, not function bodies. They are defined in library (lib).

Question 7: What are the different storage classes in C?

Answer:

There are four types of storage classes in C. They are extern, register, auto and static.

Question 8: What does static variable mean?

Answer:

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.

Question 9: How do you print an address?

Answer:

Use %p in printf to print the address.

Question 10: What are macros? What are its advantages and disadvantages?

Answer:
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.
Similarly the advantage is they can reduce time for replacing the same values.

You might also like