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.
- 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)
- Your output should be the transformed temperature (by scale).
And here is my solution:
And it is the result for this solution in my computer IDE ‘Dev C++’:
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.