Reputation: 375
How can we write the command: printf("%d->%d", X, Y);
in ALGOL where X and Y are the arguments of the recursive function.
Do we have to write something like: write "X -> Y";
?
Or can we write : write "%d -> %d, X, Y";
Upvotes: 2
Views: 739
Reputation: 5893
The question is probably more philosophical that you intended, as Algol (60) did not contain any input/output1, so there is no equivalent of printf.
Function calls in Algol (60) would look the same as in C: printf("%d->%d", X, Y);
In Algol-68, however, a standard input/output library of functions was defined - which it calls transput. As these are polymorphic the argument list would have been passed as an array of elements, thus:
print((whole(X),"->",whole(Y));
(but then you could have got that off Wikipedia anyway)
[1]:(Although most implementations added it as a library function!)
Upvotes: 0