What is the syntax to limit a decimal to 2 decimal places?
Meaning if I'm reading output using "%d" or "%f" how do I modify it to limit to 2 decimal places?
You don't read output, you write it.
%d is for integers, so I don't know what you mean by 2 decimal places.
You would use the format specifier %.2f to print a double to two decimal places.
What is the syntax to limit a decimal to 2 decimal places?
Meaning if I'm reading output using "%d" or "%f" how do I modify it to limit to 2 decimal places?
You don't read output, you write it.
%d is for integers, so I don't know what you mean by 2 decimal places.
You would use the format specifier %.2f to print a double to two decimal places.
Thanks for commenting on the obvious technical errors in my post.