Saturday, 12 August 2017

C Language O Level January-2014 Solved Paper


1. Multiple Choice


1.1 : D
Explanation :  
Integer and float both are in arithmetic statement So integer will be promoted as float . final result will be consider as float that is why sizeof operator print 4 instead of 2.

Variable is not initialized after decoration So variable will have garbage data which most of time be a negative number. So   6-1=5


1.2 : C
Explanation :  
Break is not used in switch case so when a condition is matched then all remaining code will be executed.

1.3 : C

1.4 : C

1.5 : A

1.6 : A

1.7 : D

1.8 : B 

1.9 : C

1.10 : D

2. True/False

2.1 :  F
Explanation :  
A pointer is just a number--a number which represents a memory address in a computer.  In C, a null pointer is simply a pointer whose value is 0.  That is, it "points to" the memory at address 0.  But you're not allowed to access memory at address 0, so you get an error when you do so: a segmentation fault, meaning you tried to access a segment of memory that you're not allowed to.

2.2 : T

2.3 : T

2.4 : F
Explanation :  
Only Do - while loop is post tested.

2.5: T

2.6 : F

2.7: T

2.8: F

2.9: T

2.10 : T
Explanation :  
An array is always passing by reference.

3. Match the column

1
size of void pointer in byte
F
2
p[i] can be written as  
J
3
Union                                                            
I
4
malloc()
E
5
Typedef                                                          
L
6
int(*p)[10]
A
7
Structure                                                        
G
8
calloc( ) 
C
9
int(*p)(void*,void*)
D
10
for(;;) 
B

4. Fill in the Blank

4.1 : D

4.2 : H
Explanation :  
S.N.
Macro & Description
1
NULL
This macro is the value of a null pointer constant.
2
_IOFBF, _IOLBF and _IONBF
These are the macros which expand to integral constant expressions with distinct values and suitable for the use as third argument to the setvbuf function.
3
BUFSIZ
This macro is an integer, which represents the size of the buffer used by the setbuf function.
4
EOF
This macro is a negative integer, which indicates that the end-of-file has been reached.
5
FOPEN_MAX
This macro is an integer, which represents the maximum number of files that the system can guarantee to be opened simultaneously.
6
FILENAME_MAX
This macro is an integer, which represents the longest length of a char array suitable for holding the longest possible filename. If the implementation imposes no limit, then this value should be the recommended maximum value.
7
L_tmpnam
This macro is an integer, which represents the longest length of a char array suitable for holding the longest possible temporary filename created by the tmpnam function.
8
SEEK_CUR, SEEK_END, and SEEK_SET
These macros are used in the fseek function to locate different positions in a file.
9
TMP_MAX
This macro is the maximum number of unique filenames that the function tmpnam can generate.
10
stderr, stdin, and stdout
These macros are pointers to FILE types which correspond to the standard error, standard input, and standard output streams.

4.3 : C

4.4 :  F

4.5 :  I

4.6 :  E

4.7 :  D

4.8 :  A

4.9 : G

4.10 : J

Next Question