Question

Write C++ statements that will print out how many of the elements in array numbers are divisible by 3. Given array filled wit
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Note: Could you plz go through this code and let me know if u need any changes in this.Thank You
=================================


#include <iostream>

using namespace std;

int main() {
   //Declaring variables
const int SIZE=12;
int count=0;
int numbers[]={34,45,56,67,78,89,98,86,12,24,32,44};
  
for(int i=0;i<SIZE;i++)
{
   if(numbers[i]%3==0)
   {
       count++;
       }
   }
  
   cout<<"No of elements divided by 3 is "<<count<<endl;
     
   return 0;
}

====================================

Output:

C:\Program Files (x86)\Dev-Cpp\MinGW64\bin\NoOfElements DividedBy3.exe No of elements divided by 3 is 4 Process exited after

=====================Could you plz rate me well.Thank You

Add a comment
Know the answer?
Add Answer to:
Write C++ statements that will print out how many of the elements in array numbers are...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT