Answer:
Following are the program in the C Programming Language.
//define header file
#include <stdio.h>
//define constant
#define LowerLimit 0
//define constant
#define HigherLimit 50000
//define main method
int main(void) {
//set double type variables
double fahrenheit, celsius;
int low = -1;
int high = -1;
int step = -1;
int max_steps = 0;
//set while loop which reads lower limit
while(low<(int) LowerLimit) {
printf("Please give in a lower limit, limit >= %d: ", (int)LowerLimit);
scanf("%d", &low);
}
//set while loop which reads higher limit
while((high<=low)||(high>(int) HigherLimit)) {
printf("Please give in a higher limit, %d < limit <= %d: ",low,(int)HigherLimit);
scanf("%d", &high);
}
//set while loop which reads steps
max_steps =high-low;
while((step <= 0) || (step > max_steps)) {
printf("Please give in a step, 0 < step >= %d: ", max_steps);
scanf("%d", &step);
}
//initialize the value of low in celsius
celsius =low;
//print the following table
printf("\\Celsius\t\tFahrenheit");
printf("\\-------\t\t----------\\");
//set while loop
while(celsius<=high) {
fahrenheit = (9.0 * celsius) / 5.0 + 32.0;
printf("%f\t%f\\", celsius, fahrenheit);
celsius += step;
}
return 0;
}
Step-by-step explanation:
Here, we define a main() function inside it.
Set two double data type variables and two integer type variables.
- Set the while loop that reads the lower limit from the user with a message.
- Again set the while loop that reads the higher limit from the user with message.
- We set the while loop that reads the steps from the user with a message.
- Initialize the value stored in the variable low into the variable celsius then, print the format of a table with the help of print() function.
- Finally, set the while loop which calculates the value of Fahrenheit and print the value of Celsius and Fahrenheit.