Basics - } // print out the scores for (int i=0; i <...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
#include <iostream> using namespace std ; int main() { // int scores [ 5 ] ; const int NUM_EL = 5 ; int scores [ NUM_EL ] ; scores[0] = 89 ; scores[1] = 83 ; scores[2] = 92 ; scores[3] = 71 ; scores[4] = 79 ; cout << "The third score is " << scores[2] << endl ; int scores_v2 [ NUM_EL ] = { 89, 83, 92, 71, 79 } ; // 10 points added to each score for (int i=0; i < NUM_EL; ++i) { scores_v2[i] = scores_v2[i] + 10 ;
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: } // print out the scores for (int i=0; i < NUM_EL; ++i) { cout << scores_v2[i] << " " ; } cout << endl ; // Ask the user for scores. cout << "Please input 5 scores." << endl ; int scores_v3 [ NUM_EL ] ; for (int i=0; i < NUM_EL; ++i) { cin >> scores_v3[i] ; } cout << "The entered scores were: " ; for (int i=0; i < NUM_EL; ++i) { cout << scores_v3[i] << " " ; } cout << endl ; }...
View Full Document

This note was uploaded on 10/28/2010 for the course CSCI 1113 taught by Professor Staff during the Spring '08 term at Minnesota.

Ask a homework question - tutors are online