TCS C Programming Multiple Choice Set- 3

1. atoi() function is used for:
a)convert ASCII character to integer value
b)convert a character string to its equivalent integer value
c)gets index value of character in an array
d)converts an array of characters to array of equivalent integers
Answer:b

2. Which of the following is NOT declared in string.h ?
a) strlen()
b) strcpy()
c) strptr()
d) strupr()
Answer:c

3. which of the below function is NOT declared in math.h ?
a) and()
b) pow()
c) exp()
d) acos()
Answer:a

4. Where are the local variable stored ?
a) In a Queue
b) In stack Memory
c) In hard Disk
d) In heap Memory
Answer:a

5. while declaring parameters for main, the second parameter argv should be declared as
a) char argv[]
b) char argv
c) char ** argv[]
d) char * argv[]
Answer:d

6. A memory leak happens when
a) a program allocates memory in heap but forgets to be allocate it
b) when an un-assigned pointer is used is freed using free function
c) when realloc() is called on a pointer that is not allocated
d) A program allocates memory in stack
Answer:a