본문 바로가기

개발자 모드/C언어

C언어 실수

728x90
#include <stdio.h>

int main(void)
{
	

	float f = 46.5;

	printf("%f\n", f);

	printf("%.2f\n", f);

	return 0;
}

 

 

결과

 

 

 

 

 

 

 

728x90

'개발자 모드 > C언어' 카테고리의 다른 글

C언어 scanf  (0) 2021.09.08
C언어 상수  (0) 2021.09.08
C언어 주석  (0) 2021.09.06
C언어 변수 및 상수  (0) 2021.09.06
C언어 구조체 기초  (0) 2021.09.05