Pascal Programming Help w/ loops

1.Write a program that reads a real value X
and a positive integer N and then
calculates and prints the value X^N .

2. write a program that reads a positive
integer and then find s the smallest
power of two greater than or equal
to the number that was read.

• : 1.Write a program that reads a real value X
: and a positive integer N and then
: calculates and prints the value X^N .
[code]
Program XtotheN ;
Var
Product, x : Real ;
i,n : Integer ;

begin
Write('Enter a real number ') ;
Write('Enter an integer ') ;

Product := 1 ;
for i := 1 to n do
Product := Product * x ;

WriteLn (x:0, '^', n:0, '=', Prod:0)
end.
[/code]
:
: 2. write a program that reads a positive
: integer and then find s the smallest
: power of two greater than or equal
: to the number that was read.
:
[code]
Program PwrOf2 ;
Var
n, Pwr : Word ;

begin
Write ('Enter a positive integer ') ;

Pwr = 1 ;
while Pwr < n do
Pwr := 2 * Pwr ;

WriteLn ('The smallest power of two that is greater than or equal to ',
n:0, ' is ', Pwr:0)
end.
[/code]