Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

Compile and Execute Pascal Online

Program Sqr_rt
var Num,Guess,count,sqr_rt:real;
begin
    writeln('Input the number to find the square root.');
    readln(Num);
    writeln('Input your guess.');
    readln(Guess);
    count:=0;
    repeat until count<5
    begin
        sqr_rt:=guess;
        sqr_rt:=(Num/sqr_rt+sqr_rt)/2;
        Guess:=sqr_rt;
        count:=count+1;
    end
    writeln('The square root of',Num,'is',sqr_rt:0:10)
end

Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.