Functions
A function is a block of code designed to perform a specific task and executed when "something" invokes it. More info about functions can be found in the functions chapter.
📝 Task:
[ ] Write a program to create a function named
isOdd
that passes a number45345
as an argument and determines whether the number is odd or not.[ ] Call this function to get the result. The result should be in a boolean format and should return
true
inconsole
.[ ] Write a program to create a function named
calculateRectangleArea
that takes two parameterswidth
andheight
of the rectange and should returnarea
of the rectangle.
💡 Hints:
- Visit the functions chapter to understand functions and how to create them.