Advertisement
Guest User

Untitled

a guest
Jul 21st, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.91 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3.  
  4. //int - returns integer / main - function / () - no parameters
  5. int main()
  6. {
  7.     //Standard I/O Syntax
  8.     using namespace std;
  9.     //double - real number / num1 - variable name
  10.     double num1;
  11.     //cout - output / << - output operator / endl - end line
  12.     cout << "Pick your number..." << endl;
  13.     //cin - input / >> - input operator / num1 - input variable
  14.     cin >> num1;
  15.     //double - real number / num2 - variable name
  16.     double num2;
  17.     //num2 - variable name / sqrt - math function / (num1) - parameter
  18.     num2 = sqrt(num1);
  19.     //cout - output / << - output operator
  20.     cout << "The square root of " << num1 << " is " << num2 << endl;
  21.     //cin - input operator / .get() - Cross-Platform alternative to System("PAUSE") for win32 applications
  22.     system("PAUSE");
  23.     //Returns variable EXIT_SUCCESS to integer function main
  24.     return EXIT_SUCCESS;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement