5) Consider the array called myArray declared below that contains positive and negative integers. Write a loop statement to count and display the number of integers in the array that are divisible by 4. That is, your loop should display the message "Number of integers divisible by 4 is 4". int myArray[]={1,3,9,91,40,4,-5,100,20,-23}; Note: The loop should always work without modification even if the values in the array are changed.

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter7: Arrays
Section7.2: Array Initialization
Problem 3E: (Data processing) Write a program that uses an array declaration statement to initialize the...
icon
Related questions
Question
5) Consider the array called myArray declared below that contains positive
and negative integers. Write a loop statement to count and display the
number of integers in the array that are divisible by 4. That is, your loop
should display the message "Number of integers divisible by 4 is 4".
int myArray[]={1,3,9,91,40,4,-5,100,20,-23};
Note: The loop should always work without modification even if the values in the
array are changed.
Transcribed Image Text:5) Consider the array called myArray declared below that contains positive and negative integers. Write a loop statement to count and display the number of integers in the array that are divisible by 4. That is, your loop should display the message "Number of integers divisible by 4 is 4". int myArray[]={1,3,9,91,40,4,-5,100,20,-23}; Note: The loop should always work without modification even if the values in the array are changed.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
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
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning