Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <time.h>
- #include <math.h>
- int main()
- {
- srand(time(NULL));
- int m=0;
- int dividendo=0;
- int divisor=0;
- int cociente=0;
- int residuo=0;
- int num=0;
- m=rand()%11;
- if(m<6) m=5;
- else m=4;
- num=pow(10,m);
- dividendo=rand()%num;
- divisor=rand()%100;
- printf("Dividendo: %d", dividendo);
- printf("\tDivisor: %d", divisor);
- cociente=dividendo/divisor;
- residuo=dividendo%divisor;
- printf("\nCociente: %d",cociente);
- printf("\tResto: %d",residuo);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement