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.
Program HelloWorld(output);
var w,x,y,z : integer;
begin
writeln('input a number');
readln(x);
w:=1;
y:=0;
z:=0;
for x:=1 to x do
begin
z:=z+w;
y:=y+1;
w:=w*10+1;
end;
writeln('the sum is ', z);
end.
Advertisements
We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.
AcceptLearn more