Program random_no (input, output) ;
Const m=100000000; m1=10000; q=31415821;
Var i, p, No: integer;
function mult(r, s: integer) : integer;
        Var r1, r0,s1,s0: integer;
        begin
        r1 :=r div m1 ; r0:=r mod m1 ;
        s1 :=s div m1; s0:=s mod m1;
        mult:=( ((r0*s1+r1*s0) mod m1)*m1+r0*s0)
        end ;
function random : integer ;
        begin
        p:=(mult(p, q)+1) mod m;
        random :=p;
        end ;
begin
read(No, p);
for i:=1 to No do writeln(random)
end.

Quoted Text Here
Hey guys i need help to debug this code care to lend a hand?

Given that the code was pinched verbatim from this article, my initial question is why do you think it needs debugging in the first place? Does it not work? That's somewhat likely, but I'd like to believe the article's author wouldn't publish untested code. Or does it just do something different than you wanted?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.