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

32 lines
1.2 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_div_mod.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: whaffman <whaffman@student.codam.nl> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/06/05 16:25:25 by whaffman #+# #+# */
/* Updated: 2024/06/05 16:38:01 by whaffman ### ########.fr */
/* */
/* ************************************************************************** */
void ft_div_mod(int a, int b, int *div, int *mod)
{
*div = a / b;
*mod = a % b;
}
/*
#include <stdio.h>
int main(void)
{
int a = 12;
int b = 10;
int div = 0;
int mod = 0;
ft_div_mod(a, b, &div, &mod);
printf("from %d and %d the div is %d and the mod is %d", a, b, div, mod);
return (0);
}
*/