C語言內部函式 printf()
- 2022-11-17
printf()函式是C語言中的格式化輸出函式,包含在庫函數里,格式化輸出是指按照一定的格式輸出,具體寫法為 printf(“”,); 例如: printf(“Hello,world!\n”); 輸出為: Hello,world! 如果要輸出資料,則應使用格式控制字元,常用的有%d、%c、%f等等,例如: int a=1; printf(“The number is %d。\n”,a); 輸出為 The number is 1。
printf()函式是C語言中的格式化輸出函式,包含在庫函數里,格式化輸出是指按照一定的格式輸出,具體寫法為 printf(“”,); 例如: printf(“Hello,world!\n”); 輸出為: Hello,world! 如果要輸出資料,則應使用格式控制字元,常用的有%d、%c、%f等等,例如: int a=1; printf(“The number is %d。\n”,a); 輸出為 The number is 1。