Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- uses crt;
- var
- x, n, a:integer;
- wynik:longint;
- begin
- clrscr;
- wynik:=1;
- writeln('Program sluzy do obliczania potegi danej liczby');
- writeln;
- write('Podaj liczbe ktora chcesz potegowac: ');
- readln(x);
- if (x<=0) then
- writeln('Musisz podac liczbe wieksza od 0')
- else
- begin
- write('Podaj potege powyzszej liczby: ');
- readln(n);
- a:=n;
- repeat
- wynik:=wynik*x;
- a:=a-1;
- until a < 1;
- writeln;
- writeln(x, ' do potegi ', n,' to ',wynik);
- end;
- readln;
- end.
Advertisement
Add Comment
Please, Sign In to add comment