Functions are one of the most useful tools when writing a program. Every programming language including Julia uses functions, it can be for keeping the code simple and readable or to keep the program secure from outside interference. In almost every programming language there are two types of functions:
- Fruitful Functions
- Void Functions
These are the functions that return a value after their completion. A fruitful function must always return a value to where it is called from. A fruitful function can return any type of value may it be string, integer, boolean, etc. It is not necessary for a fruitful function to return the value of one variable, the value to be returned can be an array or a vector. A fruitful function can also return multiple values.
Void functions are those that do not return any value after their calculation is complete. These types of functions are used when the calculations of the functions are not needed in the actual program. These types of functions perform tasks that are crucial to successfully run the program but do not give a specific value to be used in the program.
- Julia function keyword | Create user-defined functions in Julia
- Julia end Keyword | Marking end of blocks in Julia
- Julia continue Keyword | Continue iterating to next value of a loop in Julia
- Julia break Keyword | Exiting from a loop in Julia
- Julia local Keyword | Creating a local variable in Julia
- Julia global Keyword | Creating a global variable in Julia
- ES6 | Void Keyword
- Understanding "static" in "public static void main" in Java
- Pure Functions and Modifiers in Julia
- Functions in Julia
- Inverse functions and composition of functions
- Getting lowest and highest value of a Data type in Julia - typemin() and typemax() Methods
- Getting inverse sine and inverse hyperbolic sine in Julia - asin(), asinh() and asind() Methods
- Getting inverse cosine and inverse hyperbolic cosine in Julia - acos(), acosh() and acosd() Methods
- Getting inverse tangent and inverse hyperbolic tangent in Julia - atan(), atanh() and atand() Methods
- Getting sine and hyperbolic sine in Julia - sin(), sinh() and sind() Methods
- Getting cosine and hyperbolic cosine in Julia - cos(), cosh() and cosd() Methods
- Getting tangent and hyperbolic tangent in Julia - tan(), tanh() and tand() Methods
- Counting ones and zeros in binary representation of a number in Julia - count_ones() and count_zeros() Methods
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.