Programming - Arrays - Discussion

You Are Here :: Home > C++ Language > Arrays - Discussion

 



Q.

Consider the following declaration:
double sales[50];
int j;
Which of the following correctly initializes the array sales to 0?
(i)
for(j = 0; j < 49; j++)
sales[j] = 0;
(ii)
for(j = 1; j <= 50; j++)
sales[j] = 0;                         


A. Only (i) B. Only (ii)
C. Both (i) and (ii) D. None of these

Answer: Option A
Explaination:

 


No Explanation




Discussion

Your Comments Goes here...
NameDiscussion