25 lines
No EOL
831 B
C
25 lines
No EOL
831 B
C
/*----------------------------------------------------------
|
|
* HTBLA-Leonding
|
|
* ---------------------------------------------------------
|
|
* Title: Sum of Digits
|
|
* Author: Marc Tismonar
|
|
* ----------------------------------------------------------
|
|
* 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 |