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 Description is given below:
1) I love to read comments, but do not spam.
2) Like this blog and also tweet its posts.
3) You can use some xHTML tags.
4) All Comments are Do Follow, Please try to use blog professionally.
5) Mention Your Name below the comment.
6) You can also suggest for improvement.
7) Do not forget to subscribe Samee Articles blog.
---------------------------------------
Thanks for visiting QWC.Me.
==========================================
For free guidelines contact me on SEO Expert | Samee Ullah Feroz is online there.
==========================================
Best Regards