C sin () - C Standard Library

De functie sin () geeft de sinus van een getal terug.

Functieprototype van sin ()

 dubbele zonde (dubbele x)

De functie sin () geeft de sinus van een argument terug (hoek in radialen).

 (Wiskunde) sinx = sin (x) (In C-programmering)

Het wordt gedefinieerd in het header-bestand math.h.

De retourwaarde van sin () ligt tussen 1 en -1.

Voorbeeld: C sin () functie

 #include #include int main() ( double x; double result; x = 2.3; result = sin(x); printf("sin(%.2lf) = %.2lf", x, result); x = -2.3; result = sin(x); printf("sin(%.2lf) = %.2lf", x, result); x = 0; result = sin(x); printf("sin(%.2lf) = %.2lf", x, result); return 0; )

Uitvoer

 sin (2.30) = 0.75 sin (-2.30) = -0.75 sin (0.00) = 0.00

Interessante artikelen...