In this I will tell you how to make temperature Converter using C language . So, without wasting our time let's get started with our today's topic . Let us first see the code then we understand logic and then output.
Code:
Logic:
Here we first define two variable of type float to take input Temperature and give output Temperature that is inputTemp and outputTemp. And then we define two variable of type Char to take Character of unit in which we want to give input to program(inputType) and then for output we use (outputType). And after taking these values we first check make all case that can be possible if input in Celsius and in outputTemp variable we assign formula that we need to convert Celsius into Fahrenheit and if user want output in Kelvin then we use formula to Celsius into Kelvin. And we did same if input is in Kelvin or in Fahrenheit . And alter only formula and done with our work . You can check for formula on internet .
Output:
I hope this will help you in your work .
Thanks for reading .
No comments:
Post a Comment