aboutsummaryrefslogtreecommitdiff
path: root/c01/ex04
diff options
context:
space:
mode:
Diffstat (limited to 'c01/ex04')
-rw-r--r--c01/ex04/ft_ultimate_div_mod.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/c01/ex04/ft_ultimate_div_mod.c b/c01/ex04/ft_ultimate_div_mod.c
new file mode 100644
index 0000000..a2745fa
--- /dev/null
+++ b/c01/ex04/ft_ultimate_div_mod.c
@@ -0,0 +1,22 @@
+/* ************************************************************************** */
+/* */
+/* ::: :::::::: */
+/* ft_ultimate_div_mod.c :+: :+: :+: */
+/* +:+ +:+ +:+ */
+/* By: cacharle <charles.cabergs@gmail.com> +#+ +:+ +#+ */
+/* +#+#+#+#+#+ +#+ */
+/* Created: 2019/07/03 17:54:22 by cacharle #+# #+# */
+/* Updated: 2019/07/03 18:17:03 by cacharle ### ########.fr */
+/* */
+/* ************************************************************************** */
+
+void ft_ultimate_div_mod(int *a, int *b)
+{
+ int div_tmp;
+ int mod_tmp;
+
+ div_tmp = *a / *b;
+ mod_tmp = *a % *b;
+ *a = div_tmp;
+ *b = mod_tmp;
+}