The problem is from the book test your c skills by yashavant p. kanetkar.
Transform the scale of temperature:
In this problem, you have to transform C(Celcius) to (Fahrenheit) or F(Fahrenheit) to C(Celcius). So, you have to give your input temperature either in Celcius or in Fahrenheit.
So, your program should have 2 selection and you have to select the type of input.
Input:
- First, you have to choose the input type, I mean, select the temperature scale for input. You should do that by using 1 or 2. 1 for Fahrenheit and 2 for Celcius.
- Then input the temperature (it can be both integer and partial)
- Do (1 & 2 again and again)
Output:
- Your output should be the transformed temperature (by scale).
Example Input:
1
36
2
36
1
98.4
Example Output:
2.22
96.8
36.89
And here is my solution:
And it is the result for this solution in my computer IDE ‘Dev C++’:
1
36
exited, segmentation fault
After giving 2 input it should print a output. But it gives me this. what is segmentation fault? Is my code okay? Or, Is my IDE get dump.
Please clarify me and if there is any wrong with my program then tell me and give me a proper solution.