fork download
  1. #include<stdio.h>
  2.  
  3. int main()
  4. {
  5. char name[50], tel[15], lineId[30];
  6.  
  7. // รับข้อมูลชื่อ-นามสกุล
  8. printf("กรุณาใส่ชื่อ-นามสกุล: ");
  9. fgets(name, sizeof(name), stdin);
  10.  
  11. // รับข้อมูลเบอร์โทรศัพท์
  12. printf("กรุณาใส่เบอร์โทร: ");
  13. fgets(tel, sizeof(tel), stdin);
  14.  
  15. // รับข้อมูล Line id
  16. printf("กรุณาใส่ Line id: ");
  17. fgets(lineId, sizeof(lineId), stdin);
  18.  
  19. // แสดงผลข้อมูลที่ได้รับ
  20. printf("\nName: %s", name);
  21. printf("Tel: %s", tel);
  22. printf("Line id: %s", lineId);
  23.  
  24. return 0;
  25. }
Success #stdin #stdout 0.01s 5276KB
stdin
Standard input is empty
stdout
กรุณาใส่ชื่อ-นามสกุล: กรุณาใส่เบอร์โทร: กรุณาใส่ Line id: 
Name: Tel: Line id: