| chapter | 21 |
|---|---|
| pageNumber | 152 |
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.
-
Write a program to create a function named
isOddthat passes a number45345as 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
trueinconsole. -
Write a program to create a function named
calculateRectangleAreathat takes two parameterswidthandheightof the rectange and should returnareaof the rectangle.
- Visit the functions chapter to understand functions and how to create them.
{% if output.name == "website" %} {% aceeditor compilerTitle="Try it!" %} {% endaceeditor %} {% endif %}