Matrix multiplication doesn't works if gridDim increase 80

If i tried to run the attached program then it works fine till gridDim=80 (for square matrix of size equal to gridDim) but when i increase the size to 88 or more then it gives the constant value 2147483647 after some array value.

Please help me to find out the issue.
New_Folder.rar (2.06 KB)

This is probably an overflow problem, 2147483647 is the largest representable positive signed 32 bit integer value.

2^31 - 1 = 2147483647