Pythagoras triplet

what is wrong with my code

code link: https://ide.codingblocks.com/s/232115

you need to use long long instead of int,
Corrected code:

when are we suppose to use “long long” and when “int”

when result of any calculation you are doing can be greater than 10^9 you should take long long, in this case n is 10^9 and you are calculating n^2, which can be greater than 10^9