ft_div_mod.c
This commit is contained in:
parent
0eae69e75e
commit
f6e1accb9e
|
@ -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);
|
||||
}
|
||||
*/ ////
|
Loading…
Reference in New Issue