3) Run the C code below, and explain why it doesnt display the exact decimal number you expect. You may write it by Java ( System.out.printf("%.20f", val);) #include I/ floating point representation...


Please explain why. Thank in advance!


3) Run the C code below, and explain why it doesnt display the exact decimal number you<br>expect. You may write it by Java ( System.out.printf(
I/ floating point representation error int main() { float i, t=0.0, a=1.0, b=10.0, c; for (i=0; i<100; i++)="" t="t+0.1;" printf("\n="" adding="" 0.1,="" 100="" times="" t="%10.20f",t);" t="0.13;" printf("\n="" just="" displaying="" 0.1="%10.20f",t);" printf("\n="" result="" of="" 1/10="%10.20f",1/10);" c="a/b;" printf("\n="" c="%10.20f",c);" system("pause");="" }="" "/="">
Extracted text: 3) Run the C code below, and explain why it doesnt display the exact decimal number you expect. You may write it by Java ( System.out.printf("%.20f", val);) #include I/ floating point representation error int main() { float i, t=0.0, a=1.0, b=10.0, c; for (i=0; i<100; i++)="" t="t+0.1;" printf("\n="" adding="" 0.1,="" 100="" times="" t="%10.20f",t);" t="0.13;" printf("\n="" just="" displaying="" 0.1="%10.20f",t);" printf("\n="" result="" of="" 1/10="%10.20f",1/10);" c="a/b;" printf("\n="" c="%10.20f",c);" system("pause");="">

Jun 05, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions ยป

Submit New Assignment

Copy and Paste Your Assignment Here