ACTVTY9.3.2 Output formatting Write a single statement that prints outsideTemper
ID: 3598267 • Letter: A
Question
ACTVTY9.3.2 Output formatting Write a single statement that prints outsideTemperature with a+or -sign. End with newline. Sample output 103.500000 #include 3 int nain(void) double outsideTemperature 103.5 Your solution goes here return 0; Run Feedback? CCAIVN9.3.3 Output formatting: Printing a maximum number of digits in the fraction Write a single statement that prints outsideTemperature with 2 digits in the fraction (after the decimal point) End with a newline. Sample output 03.46 1 #include 3 int main(void) 4 double outs ideTemperature 103.45632: Your solution goes here Al be return 0: Run Feedback? 9.4 Input parsiExplanation / Answer
9.3.2:
printf("+%lf ", x) <- since the program has a hardcoded value as 103.5 , so we are directly adding '+' sign.
9.3.3:
printf("%.2lf ", x) <- we use ".2" before "lf" to print the value upto 2 decimal places
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.