67 224
Assignments Done
99,2%
Successfully Done
In November 2018

Answer to Question #13587 in C++ for marienel ortiz

Question #13587
program that will accept the 50 input numbers.after the input process, display all the numbers divisible by 5 from the input.
Expert's answer
#include <iostream>
using namespace std;


void
main()
{
const int NUM_COUNT = 50;
int arr[NUM_COUNT], index =
0;

for(int i = 0; i < NUM_COUNT; ++i)
{
int
number;
cout << "Enter number #" << i + 1 << ":
";
cin >> number;
if (number % 5 == 0 &&
number != 0)
{
arr[index] = number;

index++;
}
}
cout << "Numbers divisible by 5:"
<< endl;
for(int i = 0; i < index; ++i)
{
cout
<< arr[i] << endl;
}
cout << "\n\nEnter 0 for
exit...";
cin >> index;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions