First Upload
This commit is contained in:
34
22- recorstion2/ex3.c
Normal file
34
22- recorstion2/ex3.c
Normal file
@@ -0,0 +1,34 @@
|
||||
#include "General.h"
|
||||
|
||||
#define ASCII_ZERO '0'
|
||||
#define ASCII_NINE '9'
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------------------
|
||||
// EvenPlaceIsDigit
|
||||
// ----------------
|
||||
//
|
||||
// General : Checks whether all characters in the pairing are digits.
|
||||
//
|
||||
// Parameters :
|
||||
// str - a pointer of string (char *)
|
||||
//
|
||||
// Return value : If all characters in the pairing are digits.
|
||||
//
|
||||
//---------------------------------------------------------------------------------------
|
||||
// Programmer : Cohen Idan
|
||||
// Student No : 211675038
|
||||
// Date : 30.12.2019
|
||||
//---------------------------------------------------------------------------------------
|
||||
BOOLEAN EvenPlaceIsDigit(char * str)
|
||||
{
|
||||
if (!(*str) || !(*(str - ONE)))
|
||||
return (TRUE);
|
||||
else
|
||||
return (EvenPlaceIsDigit(str + TWO) * (ASCII_ZERO <= (*str) && ASCII_NINE >= (*str)));
|
||||
}
|
||||
|
||||
void main(void)
|
||||
{
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user