วันพฤหัสบดีที่ 18 พฤศจิกายน พ.ศ. 2553

printf() ร่วมกับ \n

การใช้ printf() ร่วมกับ \n สามารถเขียนได้สองแบบคือ
1.แบบแยก
Coding:

#include
int main (void){

printf("*****");
printf("\n");
system("pause");

}

Output:

*****
Press any key to continue . ...

2.แบบบรรทัดเดียวกัน
Coding:

#include
int main (void){

printf("*****\n");
system("pause");

}

Output:

*****
Press any key to continue . ...

ไม่มีความคิดเห็น:

Popular Posts