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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!