Programming - Arrays - Discussion

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

 



Q.

Consider the following declaration:
char name[16];
int j;
and the input is Samantha
Which of the following statements stores "Samantha" into str?
(i) cin>>name;
(ii)
for(j = 0; j < 8; j++)
cin>>name[j];
name[8] = '\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