
recursive counting in c++
Revision 0:a9ed7cd43153, committed 2016-11-07
- Comitter:
- mturner5
- Date:
- Mon Nov 07 08:34:45 2016 +0000
- Commit message:
- recursive
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
diff -r 000000000000 -r a9ed7cd43153 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Mon Nov 07 08:34:45 2016 +0000 @@ -0,0 +1,21 @@ +#include "mbed.h" +void backward_count(n, delta, min_num) +{ + cout << n; + if(n <= min_num) { + return 0; + } else { + return backward_count(n-delta, delta, min_num); + } +} + +int main() +{ + number = 25; + increment = 2; + min_number = -5; + backward_count(number,increment, min_number); + +} + +main() \ No newline at end of file
diff -r 000000000000 -r a9ed7cd43153 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Mon Nov 07 08:34:45 2016 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/9bcdf88f62b0 \ No newline at end of file