#include <stdio.h>
#include <stdlib.h>
int main()
{
int choice;
float cel, fahr;
float cent, inch;
printf("[단위 변환 프로그램]\n");
printf("[1. 섭씨-화씨]\n");
printf("[2. 센치-인치]\n");
printf(" 메뉴를 선텍하시오.");
scanf("%d", &choice);
if (choice==1) {
printf("화씨를 입력하라");
scanf("%f", &fahr);
cel=(5.0/9.0)*(fahr-32.0);
printf("섭씨 %f 도는 화씨 %f 도이다.", fahr, cent);
}
else if (choice==2) {
printf("인치를 입력하라");
scanf("%f", &inch);
cent=inch*2.54;
printf("%f 센치미터는 %f 인치이다.", inch, cent);
}
else{
printf("틀린 메뉴입니다.프로그램을 종료합니다.");
exit(0);
}
return 0;
}
저거 입력하면 값이 나오자마자 바로 프로그램이 꺼집니다..
학겨 컴퓨터실에서 할때는 조금 시간 지나서 꺼지던데 왜이러는 걸까요??
내일 시험이에요 도왖세여 ㅠㅠ
return 전에 [...]; 넣어보셈
ㄴ 오 해결됐네요 감사합니다 ㅠㅠ