What is the mistake?

@garganshul151
Problem with your input loops.
Take input in c[i] instead of c[n].
Same for d array as well.