`1

First of all, don't do this:

for (int i = 0; i < 20; i++)
...
for(int i=0; i <12; i++)

Use the length of the array:

for (int i = 0; i < tran.length; i++)
...
for(int i=0; i <inter.length; i++)

How do you know the length of an array that is passed as parameter?

-------

And as for your problem if you had tried a little you could fix it. Instead, when the slightest error occurred you immediately rushed to have someone else find it for you.

Give it a go, look carefully your code and you will find.

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.