C Programming and Problem Solving
Questions 230 to 240
231.
|
FILE is
-------------
(a) Stack (b) Pointer (c) Union (d) Structure (e) Variable.
|
Multiline macros can be defined by placing ____ at the end
of each line except the Last.
(a) / (b) # (c) @ (d) \ (e) $.
|
|
Which of the following is an advantage of using macros
over functions?
(a) Functions must
have parameters; macros do not
(b) The code
associated with a function is expanded in line
(c) Values passed to
functions must be of a specific data type; values passed to macros do not
(d) When macros are
used many times in a program they are expanded each time
(e) The code
associated with a function is not expanded in line.
|
|
m = 5 and y = ++m. The value of m and y after
incrementation is
(a) m is 5 and y is
5 (b) m is 5 and y is 6 (c)
m is 6 and y is 6
(d) m is 6 and y is
5 (e) m is 7 and y is 5.
|
|
The storage class of a local variable is
(a) Auto (b) Static (c) Extern (d) Register (e) Default.
|
|
In mixed mode expressions,
(a) Operands of
lower type get automatically converted to higher type
(b) Operands of
higher type get automatically converted to lower type
(c) Operands of
higher and lower type get interchanged
(d) Operands of
lower and higher type remain unchanged
(e) Operands of
lower type get automatically converted to lower type.
|
|
If you declare an array without stating the elements it
will be set to
(a) A null value (b) Zero (c) Garbage value
(d) Set of characters (e) Set of words.
|
|
Write the last element of the following array.
Char
flag[]=“FALSE”
(a) E (b) e (c) \0 (d) “ ” (e) /0.
|
|
Which of the following functions are used in unformatted
data files?
(a) fscanf (b) fwrite (c) fread
(d) fwrite & fread (e) fscanf & fwrite
|
|
Which of the following is “stringzizing operator”?
(a) $ (b) % (c) # (d) ? (e) &&.
|
Answers
231.
|
Answer : (d)
Reason: File is a
structure.
|
Answer : (d)
Reason: Multiline
macros can be defined using \.
|
|
Answer : (b)
Reason: The code
associated with a function is expanded in line.
|
|
Answer : (d)
Reason: First m is
incremented and then y is initialized.
|
|
Answer : (a)
Reason: For variable
the default storage class is auto.
|
|
Answer : (a)
Reason: In mixedmode
expressions Operands of lower type get automatically converted to higher
type.
|
|
Answer : (c)
Reason: Garbage value
will be set if an array is not initialized.
|
|
Answer : (c)
Reason: The last
element in the string is null character.
|
|
Answer : (d)
Reason: Unformatted
data files uses fread and fwrite.
|
|
Answer : (c)
Reason: “stringzizing
operator is # .
|
thank you.
ReplyDeletec++ tutorial
java tutorial