C Workshop
ValidateId.h File Reference
#include <stdbool.h>

Go to the source code of this file.

Functions

bool ValidateIsraeliId (const int id)
 Validate a 9-digit Israeli ID number according to the Luhn algorithm. More...
 
int SumOfDigits (int number)
 Compute the sum of the digits in a number. More...
 

Function Documentation

◆ SumOfDigits()

int SumOfDigits ( int  number)

Compute the sum of the digits in a number.

Parameters
numberThe number to sum
Returns
int The sum of the digits in the number

◆ ValidateIsraeliId()

bool ValidateIsraeliId ( const int  id)

Validate a 9-digit Israeli ID number according to the Luhn algorithm.

Parameters
idThe ID number to validate.
Returns
true if the ID number is valid, false otherwise.