Pythagoras Triplet

My 2 test cases are not passing. Can you pls check whats wrong in the code.
Link to the code: https://ide.codingblocks.com/s/214976

@anugrahrastogi
The range of variables is smaller than required
N can be 10^9,
You need a datatype of larger range than int for storing c.
Modification:
long

The change worked. But why is it so? The size of int is 2^31 - 1 which is more than 10^9.

@anugrahrastogi but u have used (10^9)*(10^9) at some places and 10^18 > 2^31 -1

Okay got it. Thanks a lot!!

@anugrahrastogi please mark your doubt as resolved and rate it as well