diff --git a/README.md b/README.md index 0d91dfe..c2b4124 100644 --- a/README.md +++ b/README.md @@ -404,13 +404,12 @@ As you can see here, it's just printing "Hello World" ten times, whether it's a `for` loop, `while` loop, or `do-while` loop. ## Functions -A function is a group of statements (commands) -that together perform a task. -There are built-in functions and functions that a -programmer will create according to his/her needs. +A function is a group of statements (commands) that together perform a task. +There are built-in functions and functions that a programmer will create +according to his/her needs. ### Sample Program Creating And Using Functions -``` +```c #include void myFunction() { @@ -420,31 +419,25 @@ void myFunction() { } int main() { - myFunction(); - return 0; } ``` -The function `printFunctionTest()` is created by -declaring `void` first. Other functions will return values -but for the sake of simplicity we create a void `function`. -A `void` function will simply execute the commands -contained in it, nothing else. +The function `myFunction()` is created by declaring `void` first. Other +functions will return values, but for simplicity, we create a void function. +A `void` function will simply execute the commands contained in it, nothing +else. -Then inside the main function, you simply invoke it -by its name. And all the commands inside that function -will be executed line by line. +Then inside the main function, you simply invoke it by its name. All the +commands inside that function will be executed line by line. -Why use functions? Imagine if there is none. Complex -programs are usually composed of thousands of lines of code -up to million, without any grouping, that will be -very hard to handle. +Why use functions? Imagine if there were none. Complex programs are usually +composed of thousands to millions of lines of code. Without any grouping, +that would be very hard to handle. -If a function is generic and can be used for other -projects, you can simply separate it for distribution. -So your code is now reusable. +If a function is generic and can be used for other projects, you can simply +separate it for distribution. So your code is now reusable. ## More Of My Content - [jdevfullstack Profile](https://github.com/jdevfullstack)