Consider the following incomplete program: /* file: remq.c */ #include #include // 1) header goes on this line int main(int argc, char** args) { int n; scanf ("%d", &n); int d; scanf ("%d", &d); int q,r; printf ("n %d d = %d\n", n, d); // 2) function call goes on this lines printf ("q = %dr = %d\n", q, r); } // 3) function definition starts here } Write a function definition (blank 3 above) with name order and with void return type!, along with the appropriate header (blank 1 above) and the function call (blank 2 above) which puts the remainder of n when divided by d in r and the integer quotient of n divided by d in value in q. For example, if the user enters (in sequence): 8, 5, then this should be the output: a printf 1 | n = 8 d 5 printf 2 q = 1 r 3

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter5: Control Structures Ii (repetition)
Section: Chapter Questions
Problem 30SA
icon
Related questions
Question
Consider the following incomplete program:
/* file:
#include <stdio.h>
remq.c */
#include <stdlib.h>
// 1) header goes on this line
int main (int argc, char** args) {
scanf ("%d", &n);
int d; scanf ("%d", &d);
int n;
int q,r;
printf ("n = %d d
%d\n", n, d);
// 2) function call goes on this lines
printf("q = %dr %d\n", q, r);
}
// 3) function definition starts here
}
Write a function definition (blank 3 above) with name order and with void return type!,
along with the appropriate header (blank 1 above) and the function call (blank 2 above)
which puts the remainder of n when divided by d in r and the integer quotient of n divided
by d in value in q. For example, if the user enters (in sequence): 8, 5 , then this should
be the output:
a
printf 1 n = 8 d 5
printf 2 q = 1 r = 3
Transcribed Image Text:Consider the following incomplete program: /* file: #include <stdio.h> remq.c */ #include <stdlib.h> // 1) header goes on this line int main (int argc, char** args) { scanf ("%d", &n); int d; scanf ("%d", &d); int n; int q,r; printf ("n = %d d %d\n", n, d); // 2) function call goes on this lines printf("q = %dr %d\n", q, r); } // 3) function definition starts here } Write a function definition (blank 3 above) with name order and with void return type!, along with the appropriate header (blank 1 above) and the function call (blank 2 above) which puts the remainder of n when divided by d in r and the integer quotient of n divided by d in value in q. For example, if the user enters (in sequence): 8, 5 , then this should be the output: a printf 1 n = 8 d 5 printf 2 q = 1 r = 3
Expert Solution
steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Knowledge Booster
Function Arguments
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning