Joao_Joao

Questão 263 Lista de Exercícios IFPB

Jun 3rd, 2022
685
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.22 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int mod(int x, int y) {
  4.   if(x < y) return x;
  5.   return mod(x - y, y);
  6. }
  7.  
  8. void main() {
  9.   int x, y;
  10.   scanf("%d%d", &x, &y);
  11.   printf("O resto da divisao de x por y eh: %d\n", mod(x, y));
  12. }
  13.  
Advertisement
Add Comment
Please, Sign In to add comment