Advertisement
yanni_yagami

remainder

Nov 8th, 2021
875
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.26 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main(void)
  4. {
  5.   int a, b, c, d;
  6.  
  7.   printf("a : ");
  8.   scanf("%d", &a);
  9.  
  10.   printf("b : ");
  11.   scanf("%d", &b);
  12.  
  13.   for(c = a, d = 0; c > b; c -= b, d++);
  14.  
  15.   printf("a %% b = %d\n", c);
  16.   printf("a / b = %d\n", d);
  17.  
  18.   return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement