+ 1
can u guys give me some examples of how to use methods in programs
other than main
2 odpowiedzi
+ 6
For example math methods like sqrt, pow,etc. Also when you use objects you define in their class specific methods for that object, like if you have Worker you can have a method called CalculateSalary.
Methods are really useful when you need to do a certain action many times to have a small code 😉
0
can u give a tough example