Skip to content

Instantly share code, notes, and snippets.

@vixtory09678
Last active April 2, 2019 14:58
Show Gist options
  • Save vixtory09678/6289453c0ab78233398c6def67003042 to your computer and use it in GitHub Desktop.
Save vixtory09678/6289453c0ab78233398c6def67003042 to your computer and use it in GitHub Desktop.
float areaCircle = getAreaCircle(5.5); // ค่าที่ function รับ เราให้มันเป็นค่า radius หรือรัศมี ดังนั้นตอนเรียก function เราควรจะกำหนดให้มันด้วย
// เมื่อ function คำนวณเสร็จแล้ว มันก็จะ return ค่า area กลับมา เราก็สามารถสร้างตัวแปรเพื่อมาเก็บค่านั้นได้
// ถ้ามองอีกมุมนึง ก็เหมือนว่า
// float areaCircle = getAreaCircle(5.5);
// มันก็คือ
// float areaCircle = area; นั่นแหละลองย้อนกลับไปดู เพราะ area คือตัวแปรที่ return กลับมาจาก code ก่อนหน้านี้
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment