Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Please answer the following in C CODE (NOT C++) 1a. Show exactly what would be p

ID: 3854070 • Letter: P

Question

Please answer the following in C CODE (NOT C++)

1a.

Show exactly what would be printed by the following statement when the value of n is 350.

printf("The value of n is %d ", n);

1b.

Show exactly what would be printed.

printf("%5d, %4d", 132, 4321);

1c.

Write a call to printf that displays the float variable x in exponential notation; left-justified in a field size of 7; two digits after the decimal point.

1d.

Suppose that a program calls scanf as follows:

scanf("%f%d%f", &x, &y, &z);

If a user enters

10.3 10.3 10.3

what will be the values of x, y, and z just after the call. Assume x and z are float variables and y is an int variable

Explanation / Answer

Question 1a:

Answer : The value of n is 350

as because n value is assigned to 350 then 350 is printed

Question 1b:

Answer :

132, 4321

there are 2 spaces before 132 because %5d means prints 5 integer is integer size is 3 then it prints spaces

Question 1c:

Answer :printf("%9.2f",x);

2 + 7 = 9

so the size is 9.2

Question 1d:

Answer :

x = 10.300000

y = 10

z = .300000

it take .3 as float input for z