วันพฤหัสบดีที่ 15 กรกฎาคม พ.ศ. 2553

B06.การจัดรูปแบบการแสดงผล

\n เป็นการสั่งให้เคอร์เซอร์ขึ้นบรรทัดใหม่

#include
int main (void){

printf("Phittaya Patiko\n");
printf("Benjamanusorn School\n");
printf("Chanthaburi");

system("pause");
}


#include
int main (void){

printf("Phittaya Patiko");
printf("\n");
printf("Benjamanusorn School");
printf("\n");
printf("Chanthaburi");

system("pause");
}


\t เป็นการสั่งให้เคอร์เซอร์เลื่อนไปทางขวา 1 ช่วงแท็บ

#include
int main (void){

printf("No.1\tPhittaya Patiko");
printf("\n");
printf("No.2\tSupot Anghan");

system("pause");
}


\a เป็นการสั่งให้เครื่องคอมพิวเตอร์ส่งเสียงระฆัง

#include
int main (void){

printf("\a");
system("pause");
}


\\ เป็นการสั่งแสดงสัญลักษณ์ \ ออกทางจอภาพ 1 ตัว

#include
int main (void){

printf("\\");

system("pause");
}


\" เป็นการสั่งแสดงสัญลักษณ์ " ออกทางจอภาพ 1 ตัว


#include
int main (void){

printf("\"");
system("pause");
}

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

Popular Posts