Ch3_PredefinedFunctions

Ch3_PredefinedFunctions - //Line 4 cout...

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

View Full Document Right Arrow Icon
// How to use predefined functions. #include <iostream> #include <cmath> #include <string> using namespace std; u int main() { double u, v; string str; cout << "Line 1: 2 to the power of 6 = " << pow(2, 6) << endl; //Line 1 u = 12.5; //Line 2 v = 3.0; //Line 3 cout << "Line 4: " << u << " to the power of " << v << " = " << pow(u, v) << endl;
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: //Line 4 cout &amp;lt;&amp;lt; &amp;quot;Line 5: Square root of 24 = &amp;quot; &amp;lt;&amp;lt; sqrt(24.0) &amp;lt;&amp;lt; endl; //Line 5 u = pow(8.0, 2.5); //Line 6 cout &amp;lt;&amp;lt; &amp;quot;Line 7: u = &amp;quot; &amp;lt;&amp;lt; u &amp;lt;&amp;lt; endl; //Line 7 str = &amp;quot;Programming with C++&amp;quot;; //Line 8 cout &amp;lt;&amp;lt; &amp;quot;Line 9: Length of str = &amp;quot; &amp;lt;&amp;lt; str.length() &amp;lt;&amp;lt; endl; //Line 9 return 0; }...
View Full Document

This note was uploaded on 03/08/2011 for the course CSIT 139 taught by Professor Duzut during the Spring '11 term at Los Angeles City College.

Ask a homework question - tutors are online