Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- //int - returns integer / main - function / () - no parameters
- int main()
- {
- //Standard I/O Syntax
- using namespace std;
- //double - real number / num1 - variable name
- double num1;
- //cout - output / << - output operator / endl - end line
- cout << "Pick your number..." << endl;
- //cin - input / >> - input operator / num1 - input variable
- cin >> num1;
- //double - real number / num2 - variable name
- double num2;
- //num2 - variable name / sqrt - math function / (num1) - parameter
- num2 = sqrt(num1);
- //cout - output / << - output operator
- cout << "The square root of " << num1 << " is " << num2 << endl;
- //cin - input operator / .get() - Cross-Platform alternative to System("PAUSE") for win32 applications
- system("PAUSE");
- //Returns variable EXIT_SUCCESS to integer function main
- return EXIT_SUCCESS;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement