11-recursion-algos/sum_of_digits.h
github-classroom[bot] 15c381aaae
Initial commit
2025-01-07 06:46:34 +00:00

25 lines
No EOL
809 B
C

/*----------------------------------------------------------
* HTBLA-Leonding
* ---------------------------------------------------------
* Title: Sum of Digits
* Author: */ your name /*
* ----------------------------------------------------------
* Description:
* Recursive and iterative implementation of an algorithm that calculates
* the sum of the digits of a given positive integer.
* ----------------------------------------------------------
*/
/* *************************************************************
* see corresponding c-file for instructions
***************************************************************/
#ifndef ___SUM_OF_DIGITS_H
#define ___SUM_OF_DIGITS_H
#include <stdbool.h>
int sum_of_digits_recursive(int n);
int sum_of_digits_iterative(int n);
#endif