Write a printf or scanf statement for each of the following: a. Print 200 with a
ID: 3838130 • Letter: W
Question
Write a printf or scanf statement for each of the following:
a. Print 200 with and without a ‘+’ sign.
b. Print 1.234 in a 9-digit field with preceding zeros.
c. Read characters into array s until the letter p is encountered.
d. Read a time of the form hh:mm:ss, storing the parts of the time in the integer variables hour, minute, and second. Skip the colons (:) in the input stream. Use the assignment suppression character.
e. Repeat (d) without using the assignment suppression character. This is for C
Explanation / Answer
(a)
(b)
(c).
(d).
output :
Enter a time in either hh:mm:ss
06:25:60
hours = 6
mins = 25
seconds=60
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.