Write a program that generates 100 random integers between 100 and 1000 inclusive and displays the number and sum of even integers divisible by 3 and number and sum of odd integers divisible by 9. Use at least three functions: one to initialize the array with random numbers, one to find the four values, and one to display all four values. Print all random integers, 12 integers on each line. Sample output: 596 572 503 226 611 466 394 900 298 476 496 396 329 549 446 118 766 393 628 973 532 392 939 237 946 765 754 962 593 882 669 319 490 103 854 805 727 661 106 979 794 211 388 446 136 318 734 176 441 425 265 225 505 947 392 769 495 264 720 886 721 414 232 217 213 485 991 748 268 579 486 690 769 602 222 210 283 274 530 892 143 548 257 906 205 669 704 516 860 931 651 711 153 610 998 112 136 364 219 992 Number of even integers divisible by 3 = 13 Sun of even integers divisible by 3= 6924 Number of odd integers divisible by 9 = 7 Sum of odd integers divisible by 9 = 3339

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter16: Searching, Sorting And Vector Type
Section: Chapter Questions
Problem 21PE
icon
Related questions
Question

C++ program

 

Add comments and attach screenshot of code and output

Write a program that generates 100 random integers between 100 and 1000
inclusive and displays the number and sum of even integers divisible by 3 and
number and sum of odd integers divisible by 9. Use at least three functions: one to
initialize the array with random numbers, one to find the four values, and one to
display all four values. Print all random integers, 12 integers on each line.
Sample output:
596 572 503 226 611 466 394 900 298 476 496 396
329 549 446 118 766 393 628 973 532 392 939 237
946 765 754 962 593 882 669 319 490 103 854 805
727 661 106 979 794 211 388 446 136 318 734 176
441 425 265 225 505 947 392 769 495 264 720 886
721 414 232 217 213 485 991 748 268 579 486 690
769 602 222 210 283 274 530 892 143 548 257 906
205 669 704 516 860 931 651 711 153 610 998 112
136 364 219 992
Number of even integers divisible by 3 = 13
Sum of even integers divisible by 3 = 6924
Number of odd integers divisible by 9 = 7
Sum of odd integers divisible by 9 = 3339
Transcribed Image Text:Write a program that generates 100 random integers between 100 and 1000 inclusive and displays the number and sum of even integers divisible by 3 and number and sum of odd integers divisible by 9. Use at least three functions: one to initialize the array with random numbers, one to find the four values, and one to display all four values. Print all random integers, 12 integers on each line. Sample output: 596 572 503 226 611 466 394 900 298 476 496 396 329 549 446 118 766 393 628 973 532 392 939 237 946 765 754 962 593 882 669 319 490 103 854 805 727 661 106 979 794 211 388 446 136 318 734 176 441 425 265 225 505 947 392 769 495 264 720 886 721 414 232 217 213 485 991 748 268 579 486 690 769 602 222 210 283 274 530 892 143 548 257 906 205 669 704 516 860 931 651 711 153 610 998 112 136 364 219 992 Number of even integers divisible by 3 = 13 Sum of even integers divisible by 3 = 6924 Number of odd integers divisible by 9 = 7 Sum of odd integers divisible by 9 = 3339
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 2 images

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