C Programming and Problem Solving
Questions 211 to 220
| 
Questions 211 to 215 are based on the code given below: 
void foo (int x, int
  & y) 
{ 
       int c; 
       c = x + y; 
       y = 2 * c; 
       x = 2 * x; 
} | |
| 
“x” and “y” are called 
(a)  Actual parameters                                                          (b)  Local variables                  
(c)  Formal
  parameters                           (d)  Local parameters                              (e) 
  Global variables. | |
| 
“c” is called 
(a)  Actual parameter                                                            (b)  Local variable                                                  
(c)  Formal
  parameter                                                           (d)  Local parameter                (e)  Global
  variable. | |
| 
The declaration “void foo (int x, int & y)”  is called a  
(a)  Function body                                 (b)  Function  
  type   
(c)  Function
  stereotype                         (d)  Function prototype        (e) 
  Function printtype. | |
| 
The function “foo” returns the following type as result 
(a)  Integer                                             (b)  No result is returned                              (c)  Float                  
(d)  Char                                                (e)  Double. | |
| 
An example of a value parameter in the code above is 
 (a)  x                      (b)  y                       (c)  c                       (d)  foo                              (e)  fo. | |
| 
C programming language was developed by 
(a)  Dennis Ritchie                                  (b)  Ken Thompson                     
  (c)  Bill Gates           
(d)  Peter Norton                                    (e)  Donald Hearn. | |
| 
When a program is running the value of a constant 
(a)  Can be changed                                                             (b)  Cannot be used 
(c)  Is always hidden                                                             (d)  Cannot be changed             (e)  Can be
  used. | |
| 
The benefit of using enumeration data types in a program is 
(a)  Program becomes shorter                (b)  Program becomes longer     
(c)  Program is easy to understand         (d) 
  Program executes faster 
(e)  Program become complex. | |
| 
What is the result of the expression 6+12*3–4/2 ? 
(a)  22                     (b)  25                     (c)  40                     (d)  52                              (e)  45. | |
| 
How many characters can a string hold when declared as
  char name [20]; ? 
(a)  18                     (b)  19                     (c)  20                     (d)  21                              (e)  22. | 
Answers
| 
211. | 
Answer :  (c) 
Reason:  The x and y
  are called as formal parameters 
  according to the definition of function. | 
| 
Answer :  (b) 
Reason:  C variable is
  local to the function that is why it is called to local variable. | |
| 
Answer :  (d) 
Reason:  Function
  prototype is the declaration of the structure of function. | |
| 
Answer :  (b) 
Reason:  No return
  type is mentioned | |
| 
Answer :  (a) 
Reason:  The other
  parameter is address parameter. | |
| 
Answer :  (a) 
Reason:  Dennis
  Ritchie developed C language. | |
| 
Answer :  (d) 
Reason:  The
  definition of constant says that it cant be changed. | |
| 
Answer :  (c) 
Reason:  Enumeration
  types minimize complexity. | |
| 
Answer :  (c) 
Reason:  First * is
  evaluated and next / is evaluated and then + or + evaluated.so 40 is the
  right choice. | |
| 
Answer :  (b) 
Reason:  String
  occupies one character as null. | 
 
 
thank you.
ReplyDeletec++ tutorial
java tutorial