C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter8: Arrays And Strings
Section: Chapter Questions
Problem 10SA
icon
Related questions
Question
-0
FAMAS oro ag
-0
1 void printVerticalGraph(int nUnits) {
2
4
9
10
11
12
13
14
15
16
17
456
BARHEIDEN
18
19
20
21
22
23
24
25
26
27
int nRev;
printf("%d\n", nUnits);
while (nUnits>0){
nRev = getReverse (nUnits);
// 1) Adjust nUnits
?? [Q1] ??
while (nRev>0){
nUnits *= 10;
// 2) Condition to print *
if(?? [Q2]??) {
printf("*");
}
// 3) Update for nUnits for * case
?? [Q3] ??
}else{
printf(" ");
// 4) Update for nUnits for
?? [Q4]??
}
// 5) Update to nRev
?? [Q5]??
printf("\n");
case
Transcribed Image Text:-0 FAMAS oro ag -0 1 void printVerticalGraph(int nUnits) { 2 4 9 10 11 12 13 14 15 16 17 456 BARHEIDEN 18 19 20 21 22 23 24 25 26 27 int nRev; printf("%d\n", nUnits); while (nUnits>0){ nRev = getReverse (nUnits); // 1) Adjust nUnits ?? [Q1] ?? while (nRev>0){ nUnits *= 10; // 2) Condition to print * if(?? [Q2]??) { printf("*"); } // 3) Update for nUnits for * case ?? [Q3] ?? }else{ printf(" "); // 4) Update for nUnits for ?? [Q4]?? } // 5) Update to nRev ?? [Q5]?? printf("\n"); case
[CC2-5]
What should be written in Q5? (Update to nRev)
OnRev=nUnits%10;
O //none
OnRev/= 2;
OnRev/= 10;
OnRev -= 1;
Transcribed Image Text:[CC2-5] What should be written in Q5? (Update to nRev) OnRev=nUnits%10; O //none OnRev/= 2; OnRev/= 10; OnRev -= 1;
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Binary numbers
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