You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
LearnCCpp/basic/1_printf.c

19 lines
539 B

#include <stdio.h>
int main()
{
int year = 2025;
float price = 9.99;
char grade = 'A';
char message[] = "Hello, World!";
unsigned int hexNum = 255;
printf("Year: %d\n", year); // d: 정수
printf("Price: %f\n", year); // f: 실수 (소수점 아래 6자리)
printf("Price2: %.2f\n", year); // .2f: 소수점 아래 두 자리 실수
printf("Grade: %c\n", grade); // c: 문자
printf("Message: %s\n", message); // s: 문자열
printf("255 to Hex: %x\n", hexNum); // x: 16진수
return 0;
}