Mod and divide : Mod « Math « C / ANSI-C






Mod and divide

  
#include <stdio.h>

int main(void)
{
  printf("%d", 7/2);
  printf(" %d", 7%2);
  printf(" %d", 4/2);
  printf(" %d", 4%2);

  return 0;
}

           
       








Related examples in the same category

1.floating-point remainder value function
2. Return remainder of floating point division: fmod Return remainder of floating point division: fmod
3.Split floating-point value into fractional and integer parts: how to use modf
4.Use the mod % operator