Pythagoras Triplet doubt

i know that c^2=a^2+b^2;

but not getting how to do this question?

you have three variables and one is fixed. you need to get a pair and that pair can fit as either (a,b) or (b,c) or (a,c) .
approach to follow:

  1. say variable x is given value
  2. Run a loop from i=1 to 10^9:
    say variable y = i
    now two variables are fixed, check if third variable fits in any of above mentioned three cases and evaluates to a perfect integer value.

Thanks