Homework 8 (due on 6/30/2014) ELET 130 Summer I 2014 1. If an integer array name
ID: 3558863 • Letter: H
Question
Homework 8 (due on 6/30/2014)
ELET 130 Summer I 2014
1. If an integer array named Ages is initialized with the following values: 7, 12, 9, 6 what will be the output of the statement:
cout << Ages;
A. This will display a compiler error.
B. 7, 12, 9, 6
C. 0
D. A hex value.
2.Given the array: int hours[8];
which for loop will cycle through each value correctly and assign the values: 1, 2, 3, 4, 5, 6, 7, 8 ?
A. for(int i=0; i<8; ++i);
{ hours[i] = i; }
B. for(int i=0; i<8; ++i)
{ hours[i+1] = i; }
C. for(int i=0; i<8; ++i)
{ hours[i] = i + 1; }
D. for(int i=0; i<7; ++i)
{ hours[i] = i + 1; }
3. In the variable initialization: char course[20] =
Explanation / Answer
1. If an integer array named Ages is initialized with the following values: 7, 12, 9, 6 what will be the output of the statement:
cout << Ages;
D. A hex value.
2.Given the array: int hours[8];
which for loop will cycle through each value correctly and assign the values: 1, 2, 3, 4, 5, 6, 7, 8 ?
C. for(int i=0; i<8; ++i)
{ hours[i] = i + 1; }
3. In the variable initialization: char course[20] =
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.