Skip to content

Instantly share code, notes, and snippets.

View jtrucolo's full-sized avatar
💻
'-

Johnny Trucolo jtrucolo

💻
'-
View GitHub Profile
@tiagodavi
tiagodavi / recursividade.php
Created November 18, 2011 22:40
Função recursiva para calcular o MDC (máximo divisor comum)
<?php
/*
@author: Tiago Davi
@blog: tiagodavi.blogspot.com
//fonte : somatematica.com.br
CÁLCULO DO M.D.C. PELO PROCESSO DAS DIVISÕES SUCESSIVAS
Regra prática:
1º) dividimos o número maior pelo número menor;
48 / 30 = 1 (com resto 18)