array_intro_with_loop - { cout <<...

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

View Full Document Right Arrow Icon
#include <iostream> using namespace std; const int SIZE = 5; int main() { int scores[SIZE] = {0}; int sum = 0; double average = 0.0; int i = 0; for (i = 0; i < SIZE; i++)
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: { cout &lt;&lt; &quot;Enter next grade: &quot;; cin &gt;&gt; scores[i]; sum = sum + scores[i]; } average = (double) sum / SIZE; cout &lt;&lt; average &lt;&lt; endl; return 0; }...
View Full Document

This note was uploaded on 04/01/2008 for the course CMPSC 101 taught by Professor Drobish,renee during the Spring '07 term at Pennsylvania State University, University Park.

Ask a homework question - tutors are online