c语言编程题目求大神帮 急求
WriteaprogramthatconvertsauserenteredtemperatureinFahrenheittoCelsiusincorporatingthr...
Write a program that converts a user entered temperature in Fahrenheit to Celsius incorporating three modules and functions named as identified below. The user entered Fahrenheit temperature is to be passed as an argument to the function named convert( ) in the module "conversion.c". The calculated Celsius value is to be return by the function and the result displayed to the user in the function main( ) :
convert_driver.c - contains the function main( ) and the user interface
conversion.h - contains the prototype for a function named convert( )
convertsion.c - contains the function definition for convert( ) 展开
convert_driver.c - contains the function main( ) and the user interface
conversion.h - contains the prototype for a function named convert( )
convertsion.c - contains the function definition for convert( ) 展开
1个回答
展开全部
convert_driver.c
#include "conversion.h"
void mian(void)
{
float temp_fah;
scanf("%fd "&temp_fah);
printf("Celsius
is %fd",temp_fah_to_celsius(tem_fah));
}
////////////////////////////////////////////////////////////////////////
conversion.h
#include <stdio.h>
#include <string.h>
float temp_fah_to_celsius(float valum);
///////////////////////////////////////////////////////////////
convertsion.c
float temp_fah_to_celsius(float valum)
{
return (valum - 32) / 1.8
}
#include "conversion.h"
void mian(void)
{
float temp_fah;
scanf("%fd "&temp_fah);
printf("Celsius
is %fd",temp_fah_to_celsius(tem_fah));
}
////////////////////////////////////////////////////////////////////////
conversion.h
#include <stdio.h>
#include <string.h>
float temp_fah_to_celsius(float valum);
///////////////////////////////////////////////////////////////
convertsion.c
float temp_fah_to_celsius(float valum)
{
return (valum - 32) / 1.8
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询