number subtraction of multiple columns

I get the point of number subtraction in one column

awk 'NR==1 {n=$1; next}; {n-=$1} END {print n}' inputfile

but I cannot figure it out how to do this to multiple
columns.

awkward.

FIle1

a 1
b 2
c 3
d 4

File 2

a 9
b 44

File3

c 5
d 8
c 4
d 0

Output

a b c d
1 2 3 4
9 44 5 8
4 0

I am not a programmer or a student so it looks like I do not understand fully your reply
to my post.
Actually I meant that one file consists of multiple columns and subtraction must be done on each column in turn.

Its better if you could post sample inputs and outputs

  1. Use while loop to read the columns.
  2. store the result of each column in a variable and subtract that.

Am not sure whether is this right or not but if you send a sample file, i can say u

Yeh, we'll need some sample files (sample input and desired output)

@awkward:
Double or cross posting is not allowed, read the forum rules:
The UNIX and Linux Forums - Forum Rules

@bogu0001:
Stop hijacking threads from other people.

Thread closed, continue here: