Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Apple Xcode
- #include <stdio.h>
- void minha_divisao(int the_quocient, int the_div, int *the_result_div, int *the_result_rest) {
- *the_result_div = the_quocient / the_div;
- *the_result_rest = the_quocient % the_div;
- }
- int main (int argc, const char * argv[]) {
- // insert code here...
- int the_quocient = 0;
- int the_div = 0;
- int the_result_div;
- int the_result_rest;
- int the_flag = 0;
- while (the_flag == 0) {
- printf("Insira o quociente: ");
- scanf("%i", &the_quocient);
- printf("Insira o dividendo: ");
- scanf("%i", &the_div);
- if (the_div == 0) {
- the_flag = 1;
- } else {
- minha_divisao(the_quocient, the_div, &the_result_div, &the_result_rest);
- printf("div = %i\n", the_result_div);
- printf("rest = %i\n", the_result_rest);
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement