Learning C for Arduino by Syed Omar Faruk Towaha

Learning C for Arduino by Syed Omar Faruk Towaha

Author:Syed Omar Faruk Towaha [Towaha, Syed Omar Faruk]
Language: eng
Format: azw3
Publisher: Packt Publishing
Published: 2017-03-24T04:00:00+00:00


Exercise

To extend your knowledge of functions, you may want to do the following exercise:

Write a program to check if a number is even or odd. (Hint: you may remember the % operator).

Write a function that will find the largest number among four numbers. The numbers will be passed as arguments through the function. (Hint: use if-else conditions).

Suppose you work in a garment factory. They need to know the area of a cloth. The area can be in float. They will provide you the length and height of the cloth. Now write a program using functions to find out the area of the cloth. (Use basic calculation in the user-defined function).



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.