variables test eas230

variables test eas230 - .. note: incorrect! " <<...

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

View Full Document Right Arrow Icon
#include <iostream> #include <string> char Id = 'm'; int xNum = 10; int total; bool stateA = false; double pi = 3.141590101010101; int main() { // try adding a char and an int: total = xNum + Id; // illegal! std::cout << "char " << Id << std::endl; std::cout << "int " << xNum << std::endl; // the total makes no sense std::cout << "total = xNum + Id.
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: .. note: incorrect! " << total << std::endl; // ture is 1, false is 0 std::cout << "a boolean " << stateA << std::endl; // set display precision to 16 characters priinted cout.precision(16); std::cout << "a double displayed with precision = 16. ... " << pi << std::endl; } // end program...
View Full Document

This document was uploaded on 12/05/2011.

Ask a homework question - tutors are online