From b8ca48ee81f511a507364295e7bceb1ee3d7e12b Mon Sep 17 00:00:00 2001 From: foxliver Date: Thu, 25 Sep 2025 17:32:16 +0900 Subject: [PATCH] =?UTF-8?q?printf()=20=EC=84=9C=EC=8B=9D=20=EC=A7=80?= =?UTF-8?q?=EC=A0=95=20-=201?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Practice_03/p03-1.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 Practice_03/p03-1.c diff --git a/Practice_03/p03-1.c b/Practice_03/p03-1.c new file mode 100644 index 0000000..480c92a --- /dev/null +++ b/Practice_03/p03-1.c @@ -0,0 +1,21 @@ +#include + +int main(){ + printf("[%d]\n", 123); + printf("[%10d]\n", 123); + printf("[%010d]\n", 123); + printf("[%-10d]\n", 123); + printf("[%d]\n", -123); + printf("[% d]\n", 123); + printf("[%#xd]\n", 0x12); + + printf("[%10s]\n", "ab"); + printf("[%-10s]\n", "ab"); + + printf("[%f]\n", 1.23456789); + printf("[%.3f]\n", 1.23456789); + printf("[%10.3f]\n", 1.23456789); + printf("[%-10.3f]\n", 1.23456789); + + return 0; +} \ No newline at end of file