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

For each of the following pairs of scanf format strings ,indicate whether or not

ID: 3616578 • Letter: F

Question

For each of the following pairs of scanf format strings ,indicate whether or not the two strings are equivalent . If they 're not , how they can be distinguished . (a) "%d"                        versus " %" (b) "%d-%d-%d"           versus "%d -%d -%d" (c) "%f"                         versus "%f " (d) "%f,%f"                   versus "%f, %f" For each of the following pairs of scanf format strings ,indicate whether or not the two strings are equivalent . If they 're not , how they can be distinguished . (a) "%d"                        versus " %" (b) "%d-%d-%d"           versus "%d -%d -%d" (c) "%f"                         versus "%f " (d) "%f,%f"                   versus "%f, %f"

Explanation / Answer

(a) "%d"                        versus " %"
these are different. the first will take an integer, the 2nddoesn't specify what type of variable is being input

(b) "%d-%d-%d"           versus "%d -%d -%d"
these are different. the first expects input as 3 integersseparated by a -, no spaces allowed, the second also expects3 integers separated by a - but now spaces are allowed

(c) "%f"                         versus "%f "
different, the 1st no space expected after the number input, the2nd you must enter a space after you input the number

(d) "%f,%f"                   versus "%f, %f"
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote