should display the message "Number of integers divisible by 4 is 4". number of integers in the array that are divisible by 4. That is, your loop and negative integers. Write a loop statement to count and display the 5) Consider the array called myArray declared below that contains positive mt myArray]=(1,3.9.91.40,4,-5,100,20,-23); array are changed.

Programming with Microsoft Visual Basic 2017
8th Edition
ISBN:9781337102124
Author:Diane Zak
Publisher:Diane Zak
Chapter8: Arrays
Section: Chapter Questions
Problem 4MQ2
icon
Related questions
Question

Solve the attachment

should display the message "Number of integers divisible by 4 is 4".
number of integers in the array that are divisible by 4. That is, your loop
and negative integers. Write a loop statement to count and display the
5) Consider the array called myArray declared below that contains positive
mt myArray]=(1,3.9.91.40,4,-5,100,20,-23);
array are changed.
Transcribed Image Text:should display the message "Number of integers divisible by 4 is 4". number of integers in the array that are divisible by 4. That is, your loop and negative integers. Write a loop statement to count and display the 5) Consider the array called myArray declared below that contains positive mt myArray]=(1,3.9.91.40,4,-5,100,20,-23); array are changed.
Expert Solution
Step 1: Program

Note:

Programming language is missing in the question. So we will answer this program in C++. If you want this program to be executed in some other programming language, kindly repost the question with a specific programming language.

Program:

#include <iostream>

using namespace std;

int main()

{

    //Initialize the array with given values

    int myArray[]={1,3,9,91,40,4,-5,100,20,-23};

    //Compute the array size

    int size=sizeof(myArray)/sizeof(myArray[0]);

    int countNumbers=0;

    /*Create a loop to count and display the number

    of integers in the array that are divisible by 4*/

    for(int ind=0;ind<size;ind++)

    {

        //check whether the integer in the array is divisible by 4

        if(myArray[ind]%4==0)

            //Increment the count

            countNumbers++;

        if(ind==size-1)

            //Display the output

            cout<<"Number of integers divisible by 4 is "<<countNumbers;

    }

    return 0;

}

Step 2: Screenahot

Computer Science homework question answer, step 2, image 1

steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
Probability Problems
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
Recommended textbooks for you
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning
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
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,