Last active
April 2, 2019 14:58
-
-
Save vixtory09678/6289453c0ab78233398c6def67003042 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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