demo-simple-if - cout <<...

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 &lt;&lt; &quot;Enter today's temperature in Fahrenheit: &quot;; cin &gt;&gt; temp; if(temp &lt; 32.0) // case that it's freezing outside { cout &lt;&lt; &quot;It's freezing today&quot; &lt;&lt; endl; } if(temp &gt;= 32.0) // case that it's not freezing { cout &lt;&lt; &quot;It's not freezing today&quot; &lt;&lt; endl; } return 0; }...
View Full Document

Ask a homework question - tutors are online