Joao_Joao

Questão 262 Lista de Exercícios IFPB

Jun 3rd, 2022
704
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 div(int x, int y) {
  4.   if(x < y) return 0;
  5.   return 1 + div(x - y, y);
  6. }
  7.  
  8. void main() {
  9.   int x, y;
  10.   scanf("%d%d", &x, &y);
  11.   printf("O quociente da divisao de x por y eh: %d\n", div(x, y));
  12. }
  13.  
Advertisement
Add Comment
Please, Sign In to add comment