ft_div_mod.c

This commit is contained in:
Timo Schmidt 2023-03-19 05:21:09 +01:00
parent 0eae69e75e
commit f6e1accb9e
1 changed files with 31 additions and 0 deletions

31
ex03/ft_div_mod.c Normal file
View File

@ -0,0 +1,31 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_div_mod.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: tischmid <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/03/19 05:17:56 by tischmid #+# #+# */
/* Updated: 2023/03/19 05:20:57 by tischmid ### ########.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 div;
int mod;
ft_div_mod(10, 3, &div, &mod);
printf("div %d mod %d\n", div, mod);
return (0);
}
*/ ////