chap 4 notes 5 - } cout << endl <<...

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

View Full Document Right Arrow Icon
5 # include <iostream> using namespace std; int main( void ) { int ave= 0 , sum= 0 , n; cout << "Enter sum : " ; cin >> sum; cout << endl << "Enter the count : " ; cin >> n; if ( n != 0 ) { ave = sum / n;
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 << endl << "Average is : " << ave << endl; return 0; } if Statement Example Since n != 0 ( n is not zero), the expression is true, and ave = sum/n ....
View Full Document

This note was uploaded on 11/16/2011 for the course COP 2271 taught by Professor Staff during the Fall '11 term at University of Florida.

Ask a homework question - tutors are online