Long time I don’t post about Pascal in this blog,and in this time,I wanna to post about the functional in Pascal,that’s arithmetic.
Arithmetic was used to operate the mathematics operation.That’s several arithmetic function in Pascal :
ABS was used to give the absolute value from an argument.
Syntax = ABS(x);
ARCTAN was used to give a value from arctangent function from Goniometri calculation.
Syntax = ARCTAN(x);
COS was used to give a value from conious function.
Syntax = COS(x);
EXP was used to calculate a rank value from e number (natural number)
Syntax = EXP(x);
FRAC was used to get a fraction value from a number.
Syntax = FRAC(x);
INT was used to give an integer value from a variable with cut a value behind coma.
Syntax = INT(x);
LN was used to calculate logarithm values from x value.
Syntax = LN(x);
SIN was used to give values from Sinus function.
Syntax = SIN(x);
SQR was used to calculate square values from a number.
Syntax = SQR(x);
SQRT was used to calculate root values from a number.
Syntax = SQRT(x);
Let’s make this project,ar.pas
program arithmetic; uses wincrt; var x:real; begin clrscr; write('Fill it with your favorite number..'); readln(x); writeln; writeln; writeln('You have choosen a fantastic number ! : ',x); writeln; writeln('If it square = ',sqr(x)); writeln('If it rooted = ',sqrt(x)); writeln('If it was seen a cosinus values = ',cos(x)); writeln('If it was seen a sinus values = ',sin(x)); writeln('If it was seen a logarithm values = ',log(x)); end.