Professional Documents
Culture Documents
if(i==j)
{
Printf(“matrix \n”);
} - 1 mark
2. The sizeof() operator is a compile-time unary operator and used to compute the size of its
operand. It returns the size of a variable. It can be applied to any data type, float type, pointer
type variables. - 2 marks
3. Variable length arguments is a programming construct that allows programmers to
pass n number of arguments to a function. You can also call variable length argument as var-
args. – 1 mark
Declaration: int maximum(int n1, int n2, int n3, int n4, int n5); // Find maximum between
five numbers - 1 mark
4. int *ptr is the declaration of pointer which stores the address of the integer variable and
int **ptr is the declaration that stores the address of the pointer storing the integer variable.
- 2 marks.
5. A stream is a logical entity that represents a file or device, that can
accept input or output. All input and output functions in standard C, operate on data streams.
Streams can be divided into text, streams and binary streams. - 2 marks
SECTION –B
ANSWER ALL QUESTIONS (5*4= 20 Marks)
6.a. Discussion of any two characteristics of static variables, such as Local static variable,
Global static variables, Variable declaration – 2 marks
Discussion of any two characteristics of register variables. - 2 marks
1. If statement
2. If-Else statement
3. Nested If-else statement
4. If-Else If ladder
5. Switch statement - 2 marks
Explanation of any two conditional statements - 2 marks
7.a. In programming terminology, a bit field is a data structure that allows the programmer to
allocate memory to structures and unions in bits in order to utilize computer memory in an
efficient manner. - 2 marks
Example program - 1 mark
Bit fields can be used to reduce memory consumption when a program requires a number of
integer variables which always will have low values. - 1 mark
- 2 marks
Similarly, you can declare a three-dimensional (3d) array. For example,
float y[2][4][3];
Here, The array y can hold 24 elements.
You can think this example as: Each 2 elements have 4 elements, which makes 8 elements
and each 8 elements can have 3 elements. Hence, the total number of elements is 24.
- 2 marks
8.a. Syntax - 1 mark
8.b. File Scope - Scope of an Identifier starts at the beginning of the file and ends at the end
of the file. It refers to only those Identifiers that are declared outside of all functions. The
Identifiers of File scope are visible all over the file Identifiers having file scope are global.
Block Scope - Scope of a Identifier begins at opening of the block / ‘{‘ and ends at the end
of the block / ‘}’. Identifiers with block scope are local to their block.
Function Prototype Scope - Identifiers declared in function prototype are visible within the
prototype.
Function scope - Function scope begins at the opening of the function and ends with the
closing of it. Function scope is applicable to labels only. A label declared is used as a target
to goto statement and both goto and label statement must be in same function.
- (1+1+1+1) = 4marks
10.b.
The ftell() function tells us about the current position in the file (in bytes).
Syntax: pos=ftell(fptr);
Syntax: rewind(fptr);
SECTION – C
ANSWER ALL QUESTIONS (3*10= 30 Marks)
11.a. List of Looping statements
i)for() ii)while() iii)do-while() - 1 mark
Working principles of for() loop - 3 marks
Working principles of while() loop - 3 marks
Working principles of do-while() loop - 3 marks
11.b. Determination of Structure within the Structure - 4 marks
Example program & Output - 6 marks
12.a. Explanation of passing a structure to function - 2 marks
Syntax - 2 marks
Example program & Output - 6 marks
12.b. malloc() - It is used to dynamically allocate a single large block of memory with the
specified size. – 0.5 mark
Syntax: ptr = (cast-type*) malloc(byte-size) - 1 mark
calloc() - It is used to dynamically allocate the specified number of blocks of memory of the
specified type. - 0.5 mark
Syntax: ptr = (cast-type*)calloc(n, element-size); - 1 mark
free() - It is used to dynamically de-allocate the memory. – 0.5 mark
Syntax: free(ptr); - 1 mark
realloc() – It is used to dynamically change the memory allocation of a previously allocated
memory. – 0.5 mark
Syntax: ptr = realloc(ptr, newSize); - 1 mark
Example program -4 marks
13.a. Declarations & Inputs - 2 marks
Program logic – 6.5 marks
Output - 1.5 marks
13.b. Declarations & Inputs - 2 marks
Program logic - 6.5 marks
Output - 1.5 marks
(Mr.P.Manivannan) (Mr.V.VenkateshBabu)
-----------------------------------------------