Answer to Question #20273 in C++ for sidra ahsaan

Question #20273
between any two integers ,find all the numbers divisible by 5 and 10.
1
Expert's answer
2012-12-07T05:00:13-0500
#include <iostream>
using namespace std;
void main()
{
intlow, high;
cout<< "Enter low range: ";
cin>> low;
cout<< "Enter high range: ";
cin>> high;

cout<< "
Divisible by 5:";
for(int i = low; i <= high; i++)
{
if(i % 5 == 0)
{
cout<< " " << i;
}
}

cout<< "
Divisible by 10:";
for(int i = low; i <= high; i++)
{
if(i % 10 == 0)
{
cout<< " " << i;
}
}
cout<< endl;
}

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 the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS