I got the result from the visual studio but I having problem

I got the result from the visual studio but I having problems to explain the process of these codings and change the coding to get a different result. I need help to solve this problem?

Question

Enter the code into Visual Studio, and run it. Explain why the output is being formatted this way. Then change the code so that the output displays differently and explain what you modified in the code to make it look different.

#include

Solution

Well, in the first code snippet which you shared. The output is formatted as follows:

.3f==> It will show only 3 digits after decimal point and all other will be dropped

.3e==> It will format the output in form in normalized form like 1.234e+02 upto .3 here means 3 digits will be omitted by the function printf after decimal point.

0.3g==> This will format and round of the value to 124.

In the second code snippet.

.11s==> This will format the output in such a manner that only 11 digits from the input string will be printed in the output, other will be ignored.

I got the result from the visual studio but I having problems to explain the process of these codings and change the coding to get a different result. I need he

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site