Try looking at the assembly language for this:
if (k != 0)
{
const int multiplier = (k > 0) ? 1 : -1;
x += (multiplier) * i;
}
Some processors may have conditional instructions that are only executed depending on the condition code (like ARM).
Look at the assembly code printed by your compiler.
Edit 1: performance concerns
A lot of modern processors have enough space in their instruction cache to that they can handle the above code efficiently. The comparison should be quick for the processor's branch decision making circuitry.
Profile or Benchmark before making any judgements about code having to be one line.