piscine/c01/ex04/ft_ultimate_div_mod.c
Willem Haffmans 607ce08c18 all
2024-09-10 00:18:01 +02:00

36 lines
1.2 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_ultimate_div_mod.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: whaffman <whaffman@student.codam.nl> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/06/05 16:40:47 by whaffman #+# #+# */
/* Updated: 2024/06/05 16:47:24 by whaffman ### ########.fr */
/* */
/* ************************************************************************** */
void ft_ultimate_div_mod(int *a, int *b)
{
int div;
int mod;
div = *a / *b;
mod = *a % *b;
*a = div;
*b = mod;
}
/*
#include <stdio.h>
int main(void)
{
int a = 15;
int b = 10;
printf("a = %d, b = %d", a, b);
ft_ultimate_div_mod(&a ,&b);
printf("a = %d, b = %d", a, b);
return (0);
}
*/