Project Euler #9 in C: Special Pythagorean triplet
Just few remarks:


Variables with meaningful names are more useful and make the code easier to read and understand.
Comments add to code clarity and could possibly point to fragments that can be optimized.
Use a more compact brace style.

int foo()
{
    for
      {
          //...
      }
}


could become

int foo(){
    for{
         //...
       }
}

Add white space between operands and operations: (a + b; a == b; a = 1).
Consistency and style: eliminate random white spaces/ indentations in expressions (p =1, p=1 or p= 1)
Brake the code into functions, each with single task.