Determine n-th power of number
Delphi & Pascal (česká wiki)
Category: Homework in Pascal
Author: Juraj Pupák
Program: Counting.pas
File exe: Counting.exe
File ubuntu: Counting
Author: Juraj Pupák
Program: Counting.pas
File exe: Counting.exe
File ubuntu: Counting
Determine n-th power of number.
{ COUNTING.PAS } { Vypocet n-tej mocniny cisla. } { } { Author: Juraj Pupak } { Date : 27.10.2006 http://www.trsek.com } program Counting; uses crt; var X,n,i,k : integer; begin clrscr; writeln('Vypocet n-tej mocniny cisla.'); writeln('----------------------------'); writeln('Zadaj cislo X'); readln(X); writeln('Zadaj exponent cisla X'); readln(n); clrscr; k := X; For i := 1 To n - 1 Do begin k := k * X; end; writeln('Vysledok ',X,'^', n, '=', k); readln; end.