C Programming and Problem Solving Questions and Answers 321 to 330

C Programming and Problem Solving

Questions 321 to 330



321.
Which of the following is “token-pasting” operator.
(a)  $$                    (b)  @                     (c)  ##                     (d)  &&                    (e)  @@.
322.
Describe the following array
int  s[5][6]   
(a)   s is a two –dimensional 30 element array(6 rows,5 columns)
(b)   s is a two –dimensional 30 element array(5 rows,6 columns)
(c)   s is a one –dimensional 30 element array(5 rows,6 columns)
(d)   s is a two –dimensional 30 element array(5 rows,5 columns)
(e)   s is a one dimensional 30 element array (6 rows,5 columns).
323.
A linker combines (_____________) and (_____________) so that they can be executed as a unit.
(a)   Object files, library files                   (b)  Source files, target files
(c)   Object files, executable files            (d)  Target files, library files
(e)   Source files, text files.
324.
Preprocessot directive, (___________), instructs the preprocessor to copy the contents of the specified file into the program.
(a)  #insert              (b)  #include            (c)  #copy               (d)  #define             (e)  #swap.
325.
Which of the following returns multiple values?
(a)  printf()     (b)  scanf()           (c)  printf&scanf()               (d)  getch()   (e)  clrscreen().
326.
What is the output of the following statements?
For(i=10;i++;i<15)
Printf(“%d”,i);
(a)  1011121314                                     (b)  101112131415   (c)  91011121314
(d)  101112131415                                  (e)  no output.
327.
What number would be shown on the screen after the following statements of c are executed?
Char ch;int i;ch=’g’;i=ch-‘a’;
Printf(“%d”,i);
(a)  6                       (b)  7                       (c)  8                       (d)  9                       (e)  5.
328.
The size of an int must be greater than or equal to that of a
(a)  long int             (b)  short int            (c)  float                  (d)  double              (e)  char.
329.
What is the output of the following statements?
Int b=5,c=15,d=8,e=8,a;
A=b>c?c>d?12:d>e?13:14:15;
Printf(“%d”,a);
(a)  13                    (b)  14                     (c)  15                     (d)  16              (e)  garbage value.
330.
A declaration float a, b; occupies ___ of memory
(a)  1 byte               (b)  4 bytes             (c)  8 bytes              (d)  16 bytes            (e)  2 bytes.

Answers


321.
Answer : (c)
Reason : Remaining all are irrelevant
322.
Answer : (b)
Reason : two dimension array is indicated with two square brackets first bracket value indicate number of rows and  second bracket indicate column value
323.
Answer : (b)
Reason : Remaining all are contradictory to the functionality of linker.
324.
Answer : (b)
Reason : #insert,#copy,#swap are irrelevant.#define is for symbolic constants.
325.
Answer : (b)
Reason : Remaining all donot match with the question.as they return single value.
326.
Answer : (e)
Reason : Just i value is assigned 0 and comes out of the loop.
327.
Answer : (a)
Reason : The difference of ascii values is 6.
328.
Answer : (b)
Reason : long int ,float,double are greater than int.char cant be because comparision is made between numeric data types.
329.
Answer : (c)
Reason : in the order of evaluation of conditional operator the final result is 15.
330.
Answer : (c)
Reason : float data type occupies 4 bytes. So totally a, b occupies 8 bytes.



<< 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 >>


No comments :

What you think about these Questions and Answers ? Let me know in comments.

Post a Comment