chap 4 notes 10 - ; failed++; } cout << endl <<...

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

View Full Document Right Arrow Icon
10 if…else Example # include <iostream> using namespace std; int main( void ) { int failed= 0 , passed= 0 , score; cout << "Enter the score : " ; cin >> score; if (score >= 60 ) { cout << endl << "This is a passing score" ; passed++; } else { cout << endl << "This is a failing score"
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ; failed++; } cout << endl << "The number of Passed students is : " << passed; cout << endl << "The number of Failed students is : " << failed << endl; return ; } Since score > 60, the expression is true, and the if block is executed....
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