C Programming and Problem Solving Questions and Answers 230 to 240

C Programming and Problem Solving

Questions 230 to 240



231.
FILE   is -------------
(a)  Stack                (b)  Pointer              (c)  Union                (d)  Structure                              (e)  Variable.
232.
Multiline macros can be defined by placing ____ at the end of each line except the Last.
(a)  /                        (b)  #                       (c)  @                     (d)  \                              (e)  $.
233.
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.
234.
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.
235.
The storage class of a local variable is
(a)  Auto                  (b)  Static                (c)  Extern               (d)  Register                              (e)  Default.
236.
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.
237.
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.
238.
Write the last element of the following array.
Char flag[]=“FALSE”
(a)  E                      (b)  e                       (c)  \0                      (d)  “ ”                              (e)  /0.
239.
Which of the following functions are used in unformatted data files?
(a)  fscanf                                             (b)  fwrite                                              (c)  fread                
(d)  fwrite & fread                                   (e)  fscanf & fwrite
240.
Which of the following is “stringzizing operator?
(a)  $                       (b)  %                     (c)  #                       (d)  ?                              (e)  &&.


Answers


231.
Answer : (d)
Reason:  File is a structure.
232.
Answer : (d)
Reason:  Multiline macros can be defined using \.
233.
Answer : (b)
Reason:  The code associated with a function is expanded in line.
234.
Answer : (d)
Reason:  First m is incremented and then y is initialized.
235.
Answer : (a)
Reason:  For variable the default storage class is auto.
236.
Answer : (a)
Reason:  In mixedmode expressions Operands of lower type get automatically converted to higher type.
237.
Answer : (c)
Reason:  Garbage value will be set if an array is not initialized.
238.
Answer : (c)
Reason:  The last element in the string is null character.
239.
Answer : (d)
Reason:  Unformatted data files uses fread and fwrite.
240.
Answer : (c)
Reason:  “stringzizing operator is # .


<< Prev 1...  2...  3...  4...  5...  6...  7...  8...  9...  10...  11... 12...  13...  14...  15...  16...  17...  18...  19...  20...  21...  22...  23...  24...  25...  26...  27...  28...  29...  30...  31...  32...  33...  34...  35...  36...  Next >>


1 comment :