Which of the following will read values from the keyboard in
Which of the following will read values from the keyboard into the array?
(Assume the size of the array is SIZE).
cin >> array;
cin >> array[ ];
for(i = 0;i < SIZE;i ++)
cin >> array[i];
cin >> array[SIZE];
| cin >> array; | ||
| cin >> array[ ]; | ||
| for(i = 0;i < SIZE;i ++) | ||
| cin >> array[SIZE]; |
Solution
Answer:
for(i = 0;i < SIZE;i ++)
cin >> array[i];
this statement will read the values from keyboard to array starting location from 0 to SIZE-1.
![Which of the following will read values from the keyboard into the array? (Assume the size of the array is SIZE). cin >> array; cin >> array[ ]; for Which of the following will read values from the keyboard into the array? (Assume the size of the array is SIZE). cin >> array; cin >> array[ ]; for](/WebImages/15/which-of-the-following-will-read-values-from-the-keyboard-in-1024216-1761530071-0.webp)