C Programming and Problem Solving
Questions 101 to 110
| 
101. | 
The
  storage class controls 
 | ||||||||||
| 
102. | 
Which
  storage class specifies local variables? 
 | ||||||||||
| 
103. | 
int  array[3][2][2]
  = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}; 
What
  value does array[2][1][0] in the
  above array contain? 
 | ||||||||||
| 
104. | 
What is the result
  for the following declaration? 
int  array[]
  = { 1, 2, 3, 4, 5 }; 
printf(
  “%d”, &array[4] - &array[0] ); 
 | ||||||||||
| 
105. | 
A
  function with no definition 
 | ||||||||||
| 
106. | 
Functions
  have 
 | ||||||||||
| 
107. | 
Given
  b=110 and c=20, what is the value of ‘a’ after execution of the
  expression               a=b-=c*=5? 
 | ||||||||||
| 
108. | 
What does the
  declaration mean? 
float  *(*a[5]) ( )[3]; 
 | ||||||||||
| 
109. | 
What is
  the base data type of a pointer variable by which the memory would be allocated
  to it? 
 | ||||||||||
| 
110. | 
Which of
  the following function calculates the square of ‘X’ in C? 
 | 
Answers
| 
101. | 
Answer :  (e) 
Reason : According to the definition of storage classes they used to define
  (a), (b) and (c). | 
| 
102. | 
Answer :  (e) 
Reason : As the auto, register and internal static variables are always the
  local variables. | 
| 
103. | 
Answer :  (d) 
Reason : According to the memory allocation of array, three rows are there as each row having 2*2 dimension
  matrix. | 
| 
104. | 
Answer :  (a) 
Reason : As it is the difference of the addresses at blocks 4 and 0,
  whatsoever the address of array may be. | 
| 
105. | 
Answer :  (d) 
Reason : According to the ANSI C rules. | 
| 
106. | 
Answer :  (c) 
Reason : According to the rules for the functions. | 
| 
107. | 
Answer :  (a) 
Reason : As the expression is evaluated from right to left. | 
| 
108. | 
Answer :  (b) 
Reason : According to the syntax rules for pointers and pointer to
  functions. | 
| 
109. | 
Answer :  (e) 
Reason : As pointer holds the addresses and an address can never be a
  negative value. | 
| 
110. | 
Answer :  (c) 
Reason : As this is the function whose prototype is defined in math.c. | 
 
 
Sorting Searching Code Examples
ReplyDeletethank you.
ReplyDeletec++ tutorial
java tutorial