diff --git a/guide/english/c/math/index.md b/guide/english/c/math/index.md index 6531d5e61d..f7f43bed2f 100644 --- a/guide/english/c/math/index.md +++ b/guide/english/c/math/index.md @@ -108,17 +108,20 @@ Give that a run to see what happens, and be sure to play with the operators and # Math library C provides a math library (`math.h`) that provides multiple useful math functions. As an example, the power of a number can be calculated as: -```#include +```c +#include int result = pow(2,3) // will result in 2*2*2 or 8 ``` Some other (`math.h`) library functions that may prove useful are: -```#include +```c +#include double angle = cos(90.00); // Givs us 0.00 int result = sqrt(16); // Gives us 4 double result = log(10.00) // Gives us 2.30 (note this is ln(10), not log base 10) ``` + ```c // C code to illustrate // the use of ceil function. diff --git a/guide/portuguese/c/math/index.md b/guide/portuguese/c/math/index.md index 35678a2e9b..4a89331ee3 100644 --- a/guide/portuguese/c/math/index.md +++ b/guide/portuguese/c/math/index.md @@ -132,7 +132,8 @@ Dê uma corrida para ver o que acontece e não se esqueça de jogar com os opera C fornece uma biblioteca de matemática ( `math.h` ) que fornece várias funções matemáticas úteis. Por exemplo, o poder de um número pode ser calculado como: -```#include +```c +#include int result = pow(2,3) // will result in 2*2*2 or 8 ``` diff --git a/guide/spanish/c/math/index.md b/guide/spanish/c/math/index.md index 47f57ff000..4477600a78 100644 --- a/guide/spanish/c/math/index.md +++ b/guide/spanish/c/math/index.md @@ -132,7 +132,8 @@ Dale una oportunidad para ver qué pasa, y asegúrate de jugar con los operadore C proporciona una biblioteca matemática ( `math.h` ) que proporciona múltiples funciones matemáticas útiles. Como ejemplo, la potencia de un número se puede calcular como: -```#include +```c +#include int result = pow(2,3) // will result in 2*2*2 or 8 ```