I'm a beginner to C, and I'm having some trouble formatting a simple printf function that takes two integers, a & b and prints out a^2 + b^2 = c, where I assign c to be a*a + b*b..
That being said, I'm not sure how the parameters of C's printf statement work, this is what I wrote:
printf("%i,a ^2 + (%i,b) ^2 = %i,c", a, b, c); And this is what it's printing
3,a ^2 + (4,b) ^2 = 25,c10,a ^2 + (10,b) ^2 = 200,c Which isn't too far off, I just don't know how to get rid of the ugly variables & parenthesis I have going on like (4,b)
This is what it is supposed to look like. I know I'm missing a "\n" in there somewhere also.
3^2 + 4^2 = 25 10^2 + 10^2 = 200