@@ -404,13 +404,12 @@ As you can see here, it's just printing "Hello World" ten times, whether it's
404
404
a ` for ` loop, ` while ` loop, or ` do-while ` loop.
405
405
406
406
## Functions
407
- A function is a group of statements (commands)
408
- that together perform a task.
409
- There are built-in functions and functions that a
410
- programmer will create according to his/her needs.
407
+ A function is a group of statements (commands) that together perform a task.
408
+ There are built-in functions and functions that a programmer will create
409
+ according to his/her needs.
411
410
412
411
### Sample Program Creating And Using Functions
413
- ```
412
+ ``` c
414
413
#include < stdio.h>
415
414
416
415
void myFunction () {
@@ -420,31 +419,25 @@ void myFunction() {
420
419
}
421
420
422
421
int main () {
423
-
424
422
myFunction ();
425
-
426
423
return 0;
427
424
}
428
425
```
429
426
430
- The function ` printFunctionTest() ` is created by
431
- declaring ` void ` first. Other functions will return values
432
- but for the sake of simplicity we create a void ` function ` .
433
- A ` void ` function will simply execute the commands
434
- contained in it, nothing else.
427
+ The function ` myFunction() ` is created by declaring ` void ` first. Other
428
+ functions will return values, but for simplicity, we create a void function.
429
+ A ` void ` function will simply execute the commands contained in it, nothing
430
+ else.
435
431
436
- Then inside the main function, you simply invoke it
437
- by its name. And all the commands inside that function
438
- will be executed line by line.
432
+ Then inside the main function, you simply invoke it by its name. All the
433
+ commands inside that function will be executed line by line.
439
434
440
- Why use functions? Imagine if there is none. Complex
441
- programs are usually composed of thousands of lines of code
442
- up to million, without any grouping, that will be
443
- very hard to handle.
435
+ Why use functions? Imagine if there were none. Complex programs are usually
436
+ composed of thousands to millions of lines of code. Without any grouping,
437
+ that would be very hard to handle.
444
438
445
- If a function is generic and can be used for other
446
- projects, you can simply separate it for distribution.
447
- So your code is now reusable.
439
+ If a function is generic and can be used for other projects, you can simply
440
+ separate it for distribution. So your code is now reusable.
448
441
449
442
## More Of My Content
450
443
- [ jdevfullstack Profile] ( https://github.com/jdevfullstack )
0 commit comments