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

The following printf call from line h in the program may not compile: printf(\"I

ID: 3749305 • Letter: T

Question

The following printf call from line h in the program may not compile: printf("I%-10.31 %12.31 %10mn", , x); What is the problem? 4. 5. What symbol is used in front of a variable name in the scanf call? 6. There is a syntax error in the following printf statement. int x; printf("The answer to the question is: %d le", &x); Fix it. Given the following printf call. printf("The balance on your account is: %7.2fp". x); How many digits to the right of the decimal will be displayed? How many spaces will the computer reserve to display this number including the decimal point? Change this printf call so that a dollar sign will appear in front of the number. 7. 8. 9. 10. Below is a small section of code. printf("Enter two numbers separated by a comma: " scanf("%d%d", &i, &j); As presented you will get an error message for the scanf function. input directions. Modify it to match the user

Explanation / Answer

4. Because here the printf is showing three %f. But only twice the related variable is assigned.
5. & --> is used to store the value in a particular memory
6. & should not be used in printf with %d. it should be used with %u to get the memory address
7. 2 will displayed as .2 is given
8. no of digits before decimal + . + 2 decimals
9. printf("The balance on your account is: $7.2f ",x);
10. scanf("%d,%d",&i, &j);

Let me know if you have any queries or clarifications.... :)