Are the inputs correlated and if so are they in the same order?
If not, do you want all 400 combinations, or something else?
If you expect 20 lines of output, and your 20 lines are both files in the matching order, you probably just want:
paste -d ' ' name.txt surname.txt > names.txt
paste
uses a tab character as the default output field seperator. You can learn about this with man paste
in most systems.
If they aren't in the same order, you can either sort them manually, or add some field to sort on that custom field, then join them by the field.
e.g.
$ cat name.txt
2 frodo
1 samwise
$ cat surname.txt
1 ganges
2 baggins
$ join -j1 <(sort -n name.txt) <(sort -n surname.txt)
1 samwise ganges
2 frodo baggins