Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program Maximum;
- var
- a,b,c,d,e,f,g,h,i,j: integer;
- function Max(v1,v2: integer): integer;
- var n: integer;
- begin
- {return max value}
- n:=v1;
- if v2>v1 then
- n:=v2;
- Max:=n;
- end; {Max}
- function FindMax: integer;
- var n: integer;
- begin
- {return the max value}
- n:=Max(a,b); n:=Max(n,c);
- n:=Max(n,d); n:=Max(n,e);
- n:=Max(n,f); n:=Max(n,g);
- n:=Max(n,h); n:=Max(n,i);
- n:=Max(n,j); FindMax:=n;
- end; {FindMax}
- begin
- {assign values}
- readln(a);
- readln(b);
- readln(c);
- readln(d);
- readln(e);
- readln(f);
- readln(g);
- readln(h);
- readln(i);
- readln(j);
- {write the max value (should be (e)9)}
- writeln('Max value is ',FindMax);
- readln;
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement