//============================================================================
// 제출일 : 2005. 3. 12
// 작업환경 : Windows XP SP1, VC++ 6.0, Pentium4
// 연습문제 4-39
//============================================================================
#include <iostream.h>
void C2F(float input) //썹씨를 화씨로 고치는 함수
{
float output;
output = 32 + input*(180/100); //변환식
cout << output <<" F degree\n"; //출력
return;
}
void F2C(float input) //화씨를 썹씨로 고치는 함수
{
float output;
output = (input-32)*100/180; //변환식
cout << output <<" C degree\n"; //출력
return;
}
int main()
{
float temp;
cout << "Enter Centigrade temperature :\n";
cin >> temp;
C2F(temp);
cout << "Enter Fathrenheit temperature :\n";
cin >> temp;
F2C(temp);
return 0;
}
'Studies > A Structured Approach Using C++' 카테고리의 다른 글
Project 4-41 Create customers' bills 영수증 발행 (0) | 2008.08.23 |
---|---|
Project 4-40 Random number 랜덤 (0) | 2008.08.23 |
Project 4-38 Compute the interest and print the balance (0) | 2008.08.23 |
Project 4-37 Prepare a payroll earnings statement (0) | 2008.08.23 |
Problem 4-35 print the ceiling, floor, and rounded value of a floating-point number (0) | 2008.08.23 |