CHALLENGE 5.4.5: Printing vector elements separated by commas, ACTIVITY Write a for loop to print all NUM_VALS elements
Posted: Tue Jul 12, 2022 8:21 am
CHALLENGE 5.4.5: Printing vector elements separated by commas, ACTIVITY Write a for loop to print all NUM_VALS elements of vector hourly Temp. Separate elements with a comma and space. Ex: If hourly Temp = (90, 92, 94, 95), print: 90, 92, 94, 95 Your code's output should end with the last element, without a subsequent comma, space, or newline. 5 int main() { 6 7 8 9 10 11 12 13 14 15 16 17 18 19 } Run const int NUM_VALS = 4; unsigned int i; vector<int> hourlyTemp (NUM VALS); for (i = 0; i < hourlyTemp.size(); ++i) { cin >> hourlyTemp.at(i); * Your solution goes here cout << endl; return 0; liolio passed All sta Feedback?