bits[1] (1)
bits[1] (1)
Which keyword is used to make the array size optional in C language during array
declaration?
a)auto b)static c)extern d) register Ans:C
5. Which of the following does not initialize ptr to null (assuming variable declaration
ofaasinta=0;)?
a)int*ptr=&a;
b)int*ptr=&a–&a;
c)int*ptr=a–a;
d) All of the mentioned Ans :A
7. Arguments that take input by user before running a program are called_________ Ans:
Command-Line arguments
Ans: int
10. ____________ operator connects the structure name to its member name? Ans: dot
(.)operator
11. The value obtained in the function is given back to main by using ________ keyword.
Ans: return
12. What type of value does sizeof return__________ Ans: unsigned int
13. ___________header files must necessarily be included to use dynamic memory allocation
functions? Ans: stdlib.h
15. What will strcmp() function do? Ans: compares the string.
a) Self Function
b) Auto Function
c) Recursive Function
d) Static Function Ans: C
a) 16
b) 31
c) 32
d) No Limit Ans: D
22. _________functions allocates multiple blocks of memory, each block of the same size?
Ans: calloc()
23. ____________keywords is used to define an alternate name for an already existing data
type? Ans: typedef
24. What is the return-type of the function sqrt() _________ Ans: double
25. _________ function will you choose to join two words. Ans: strcat()
26. Array sizes are optional during array declaration by using ______ keyword.
Ans: extern
27. _______ function tests for any character that is an uppercase letter. Ans: isupper()
Ans: structures
30. The______ function returns the number of characters that are present before the
terminating null character. Ans: strlen()
a) Heap
c) Free memory
d) Stack
32. 2. In the function malloc(), each byte of allocated space is initialized to zero. ANS:B
a) True
b) False
b) welcome
d) junk value
34. In the function realloc(), if the new size of the memory block is larger than the old size,
then the added memory ___________ ANS:D
b) is initialized to zero
c) results in an error
d) is not initialized
35. The free() function frees the memory state pointed to by a pointer and returns
___________ ANS:C
c) no value
d) an integer value
36. Which code from the given option return pointer to last occurrence of c in ch or NULL if
not present? ANS:B
a) char *strchr(ch, c)
b) char *strrchr(ch, c)
c) char *strncat(ch, c)
d) char *strcat(ch, c)
a) true
b) false
a) int
b) float
c) double
39. Which of the following does not initialize ptr to null (assuming variable declaration of a
as int a=0;)? ANS:A
c) int *ptr = a – a;
a) Matrix-Multiplication
41. calloc() initialize memory with all bits set to zero. ANS:A
a) True
b) False
a) Nothing
c) To invoke a function
a) Internal
b) External
44. What will be the data type returned for the following C function? ANS:B
#include <stdio.h>
int func()
{
return (double)(char)5.0;
}
a) char
b) int
c) double
45. What would happen if you create a file stdio.h and use #include “stdio.h”? ANS:B
a) Yes
b) No
a) True
b) False
a) True
b) False
49. Which of the following file extensions are accepted with #include? ANS:D
a) .h
b) .in
c) .com
a) True
b) False
a) union-name.member
b) union-pointer->member
a) Array of structures
b) Linked Lists
c) Binary Tree
a) struct
b) enum
c) typedef
55. Which operator connects the structure name to its member name?ANS:C
a) –
b) <-
c) .
56. When compiler accepts the request to use the variable as a register?ANS:A
a) It is stored in CPU
a) int
b) long
c) float
d) all of the mentioned
58. Which among the following is the correct syntax to declare a static variable register?
ANS:D
a) static register a;
b) register static a;
59. If the file name is enclosed in double quotation marks, then _________ANS:A
a) header.h.h
b) 123header.h
c) _head_er.h