카테고리 없음
C 언어 월급 계산
갈릭새우칩
2019. 6. 10. 21:35
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
#include <stdio.h>
#include <math.h>
int main()
{
float month = 0.0;
int result = 0;
printf("월급을 입력하시오 : ");
scanf("%f", &month);
result = round(month * 120);
printf("당신의 연봉은 : %d 입니다.", result);
return 0;
}
|
|
round() 함수 : 반올림을 해준다.
round() 함수를 사용하기 위해 #include <math.h> 를 사용한다.
Ceil() 올림 floor() 버림