Question: Write a program in C that outputs like following: Example 1 Enter the temperature outside: 10.25 Enter the unit of temperature: C It is 10.25C
Write a program in C that outputs like following:
Example 1
Enter the temperature outside: 10.25
Enter the unit of temperature: C
It is 10.25C outside.
Example 2
Enter the temperature outside: 56.248
Enter the unit of temperature: F
It is 56.25F outside.
#include
int main(){ double temp; char units; printf("Enter the temperature outside: "); scanf("%lf", &temp); printf("Enter the unit of temperature: "); scanf("%c", &units); printf("It is %.2lf%c outside. ", temp, units); return 0; }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
