Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program homework;
- uses CRT;
- function pow(x:double; n:integer):double;
- var
- i:integer;
- total:double;
- begin
- total := 1.0;
- for i:=1 to n do
- begin
- total := total * x;
- end;
- pow := total;
- end;
- function polynom(x:double):double;
- begin
- polynom := 1 - 2 * x + 3 * pow(x, 2) - 4 * pow(x, 3) + pow(x, 4);
- end;
- var
- x:double;
- begin
- clrscr;
- writeln('Enter x: ');
- readln(x);
- writeln('Result: ', polynom(x):3:3);
- readkey;
- end.
Add Comment
Please, Sign In to add comment