demo-simple-if - cout<<"Enter today's temperature...

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

View Full Document Right Arrow Icon
// Programmer: Doug Hogan // Section: N/A - Demo // Program: 1 // Date: July 17, 2008 // Description: This program reads in a temperature in degrees // Fahrenheit and interprets it for the user. // [Demo program for basic if statements] #include <iostream> using namespace std; int main() { double temp; // today's temperature in degrees Fahrenheit
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 << "Enter today's temperature in Fahrenheit: "; cin >> temp; if(temp < 32.0) // case that it's freezing outside { cout << "It's freezing today" << endl; } if(temp >= 32.0) // case that it's not freezing { cout << "It's not freezing today" << endl; } return 0; }...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online