C++ supports many mathematical functions.All mathematical functions are defined in cmath library.
1)Square root
Sol) we have to use sqrt() function to find square root of a number .
C++ Code :
#include <iostream>
#include <cmath>
using namespace std;
int main(){
int n;
cout << "Enter a number to find square root :
";
cin >> n;
cout << "Square root of " << n << "
is " << sqrt(n);
}
Output :
2) sin function
Sol) We have to use sin() function to find the sin value of a number.
C++ Code :
#include <iostream>
#include <cmath>
using namespace std;
int main(){
double n;
cout << "Enter a number to find sin value :
";
cin >> n;
cout << "sin value of " << n << " is
" << sin(n);
}
Output
3) ln
Sol) ln is nothing but natural logarithm.Using log() function we can calculate ln value.
C++ Code :
#include <iostream>
#include <cmath>
using namespace std;
int main(){
double n, ln_value;
n = 3.2;
ln_value = log(n);
cout << "log(" << n << ") = "
<< ln_value;
}
Output :
please up vote. Thank You.
Write c++ codes for the following mathmatical function : Square root Sin Ln
Simple C programming 1.Write a function in standard C library to obtain the square root of a int. 2.Write a function in standard C library to obtain the square root of a float.
.5LN 2= -LN | CSCX-COTX | +( LN ((SQUARE ROOT 2) +1|)). solve for X
please show all work so i can understand Write f(x)=ln((x^2 square root(x-4)/(x+1)^3)) in terms of lnx, ln(x+1), and ln(x-4). Then find f '(x).
Write a Haskell function integerSqrt that returns the integer square root of a positive integer n. (The integer square root is defined to be the largest integer whose square is less than or equal to n, i.e. the result of integerSqrt 15 is 3.). integerSqrt :: Integer -> Integer
Convert the code you developed to obtain square root value into a function that returns square root of a float value argument. The answer is of float type. This function can be named sqrtC and it has one (float) parameter going in and one value (the result) coming out. Write code in C language.
1, describe the domain of f(x,y) =ln(xy)/square root (x+y).
Write the equation of the square root function described. The function value, f(x), is an ordered pair,(x,f(x) , on a circle of radius 5 with its center at the origin of a coordinate system. (Hint: The equation for a circle of radius r and its center at (0,0) x^2+y^2=r^2) and what value of r is the known surface area of a sphere, given by the function S(r)=4πr^2, numerically equal to the known volume of the sphere given by the function...
Given the graph of the following function, graph the corresponding square root function on the same grid. y 57 4+ 3 2t 1 + x 3 O -7 2. -6 -5 -2 4 -3 1 -1 2+ -3 -4+ -5
Disprove the following by demonstrating a counter example. 1. The square root function has the additive property.
sen(2u) if we know that cos(u)=8/ square root 64+25x^2 sin(2u) if cos(u)=8/ square root 64+25x^2 Sen (zu) si sabemos que cos (u)- √64+ 25x²