C Programming 11L106
C Programming 11L106
Reg.No:
2011
7
Maximum : 20 Marks
Instructions: (Kindly mention here any special instructions such as the Codes,
Data Books, Charts, Tables, Drawing and Graph Sheets to be
supplied or permitted.)
PART - A (20 x 1 = 20 Marks)
Answer All Questions
(Instructions to the Candidate : Write the appropriate answer in Page No.3 of your
Answer book)
1.
2.
3.
4.
5.
6.
7.
8.
D) >>
The correct syntax for running two variable for loop simultaneously is.
A) for (i = 0; i < n; i++) for (j = 0; j < n; j += 5)
B) for (i = 0, j = 0;i < n, j < n; i++, j += 5)
C) for (i = 0; i < n;i++){} for (j = 0; j < n;j += 5){}
D) for (i = 0; i < 5;i++){} for (j = 0; j < n;j += 5){}
Which of the following cannot be checked in a switch-case statement?
A) Character
B) Integer
C) Float
D) All of the mentioned
Comment on the following statement:
int (*a)[7];
A) An array a of pointers.
B) A pointer a to an array.
C) A ragged array.
D) Array Pointers
9. Which of the following is not possible statically in C?
A) Jagged Array
B) Rectangular Array
C) Cuboidal Array
D) Multidimensional Array
10. What will be the output of the program?
#include<stdio.h>
#include<stdlib.h>
union employee
{
char name[15];
int age;
float salary;
};
const union employee e1;
int main()
{
strcpy(e1.name, "K");
printf("%s %d %f", e1.name, e1.age, e1.salary);
return 0;
}
12.
13.
14.
15.
16.
17.
18.
19.
20.
Any C program
A) Must contain at least one function.
B) Need not contain any function.
C) Needs input data.
D) None of the above
The default parameter passing mechanism is
A) call by value
B) call by reference
C) Call by result
D) Change by value
In function free(p), p is a:
A) int
B) Pointer returned by malloc()
C) Pointer returned by calloc()
D) Both b & c
The function ____ obtains block of memory dynamically.
A) calloc
B) malloc
C) Both a & b
D) free
Which of the following cannot be a structure member?
A) Another structure
B) Function
C) Array
D) None of the mentioned
Memory allocation using malloc() is done in?
A) Static area
B) Stack area
C) Heap area
D) Both b & c
For binary files, a ___ must be appended to the mode string.
A) Nothing
B) b
C) binary
D) 01?
User-defined data type can be derived by___________.
A) struct
B) Enum
C) typedef
D) All the above
Which operator connects the structure name to its member name?
A) _
B) +
C) .
D) <Page 3/4
Maximum : 80 Marks
(12)
(12)
(12)
(12)
(12)
(12)
(12 )
********************
Page 4/4
(12)
(12)
(12 )