76.9k views
4 votes
1

write a single statement that prints outsidetemperature with a + or - sign. end with newline. sample output:
+103.500000
#include
int main(void {
double outsidetemperature = 103.5;
/* your solution goes here */
return 0;
}
2
write a single statement that prints outsidetemperature with 2 digits in the fraction (after the decimal point. end with a newline. sample output:
103.46
#include
int main(void {
double outsidetemperature = 103.45632;
/* your solution goes here */
return 0;

1 Answer

5 votes
Have a look at the man page for printf:

man 3 printf
User Sunghee Yun
by
8.2k points