Using Math Library Beginning Functions:
Here you will learn about Math Library Beginning Functions. Like- Cos
- Sin
- Tan
- Sqrt
- Pow
- Log
- And More
sqrt function >> Square root function >> text with the √ symbolIn below given code, you will learn that
1st) You should add
#include <cmath>into the header. It is mathematics library in C Plus Plus, in which you can find all important math functions.
double num2;Here I am taking the square root of num1 variable. likewise, you just need to try same functionality to all math type functions.
num2 = sqrt (num1);
/*
Name: beginning functions
Copyright: sameearticles.blogspot.com
Author: Samee Ullah Feroz
Date: 26/01/14 23:49
Description: Using Math library functions....
*/
#include <iostream>
#include <cmath> //it is for all math functions library
int main() //it is actually a function here
{
using namespace std;
double num1;
cout << "pick your number...." << endl;
cin >> num1;
double num2;
num2 = sqrt(num1); // variable not in quotes
cout << "The square root of = " << num1 << " is " << num2 << endl;
system("pause");
return 0;
}
Try it.
C++ | Beginning Functions > Using math library functions | Lecture 4 http://t.co/Z6VcSCimu0
— Quality Written Code (@QWCME) February 14, 2014

Post a Comment
Give your reviews about this blog. Leave your comments. What do you think about this post?
Comments Guidelines:
1) I love to read comments, but please avoid spam.
2) Like this blog, share your insights, and spread the word.
3) You can use basic HTML/xHTML tags.
4) All comments are DoFollow—please use the section professionally.
5) Kindly mention your name or brand below your comment.
6) Constructive suggestions for improvement are always welcome.
7) Do not forget to explore our main agency platform at pingbooster.site.
Thanks for visiting Samee Articles.
========================================
Explore custom digital solutions and WordPress plugins at PingBooster Plugins.
Best Regards,
Samee U. Feroz