Total Pageviews

Category 2

Featured Articles

Decoration

All Stories
Showing posts with label Professional Knowledge Quiz. Show all posts
Showing posts with label Professional Knowledge Quiz. Show all posts

Sunday 9 March 2014

Professional Knowledge Quiz


1. What will happen if in a C program you assign a value to an array element whose subscript exceeds the size of array?

A. The element will be set to 0.
B. The compiler would report an error.
C. The program may crash if some important data gets overwritten.
D. The array size would appropriately grow.


2. What does the following declaration mean?

int (*ptr)[10];

A. ptr is array of pointers to 10 integers
B. ptr is a pointer to an array of 10 integers
C. ptr is an array of 10 integers
D. ptr is an pointer to array

3. In C, if you pass an array as an argument to a function, what actually gets passed?

A. Value of elements in array
B. First element of the array
C. Base address of the array
D. Address of the last element of array

4. The keyword used to transfer control from a function back to the calling function is

A. switch
B. goto
C. go back
D. return


5. How will you free the allocated memory ?

A. remove(var-name);
B. free(var-name);
C. delete(var-name);
D. dalloc(var-name);

6. What is the similarity between a structure, union and enumeration?

A. All of them let you define new values
B. All of them let you define new data types
C. All of them let you define new pointers
D. All of them let you define new structures

7. What is (void*)0?

A. Representation of NULL pointer
B. Representation of void pointer
C. Error
D. None of above


8. Can you combine the following two statements into one?

char *p;
p = (char*) malloc(100);

A. char p = *malloc(100);
B. char *p = (char) malloc(100);
C. char *p = (char*)malloc(100);
D. char *p = (char *)(malloc*)(100);

9. In which header file is the NULL macro defined?

A. stdio.h
B. stddef.h
C. stdio.h and stddef.h
D. math.h

10. How many bytes are occupied by near, far and huge pointers (DOS)?

A. near=2 far=4 huge=4
B. near=4 far=8 huge=8
C. near=2 far=4 huge=8
D. near=4 far=4 huge=8



ANSWERS:
1. C
2. B
3. C
4. D
5. B
6. B
7. A
8. C
9. C
10. A


05:10 - By Unknown 0

back to top