can some one simply the end of this program with while loops and please explain why you solution works?
#include <cstdlib>
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
srand(time(0));
int number;
int max = 100;
int min = 0;
int repetetion;
int oneToTen = 0;
int elevenToTwenty = 0;
int twentyToThrity = 0;
int thirtyToFourty = 0;
int fourtyToFifty = 0;
int fiftyToSixty = 0;
int sixtyToSeventy = 0;
int seventyToEighty = 0;
int eightyToNinety = 0;
int ninetyToOneHundred = 0;
repetetion = 0;
while (repetetion < 10000)
{
number = rand()% (max - min + 1) + min;
if (number < 11 && number > 0)
{
++oneToTen;
}
if (number < 21 && number > 10)
{
++elevenToTwenty;
}
if (number < 31 && number > 20)
{ ++twentyToThrity;
}
if (number < 41 && number > 30)
{
++thirtyToFourty;
}
if (number < 51 && number > 40)
{
++fourtyToFifty;
}
if (number < 61 && number > 50)
{
++fiftyToSixty;
}
if (number < 71 && number > 60)
{
++sixtyToSeventy;
}
if (number < 81 && number > 70)
{
++seventyToEighty;
}
if (number < 91 && number > 80)
{
++eightyToNinety;
}
if (number < 101 && number > 90)
{
++ninetyToOneHundred;
}
++repetetion;
{
}
}
{
cout << "Welcome to the Random Number Historgram Program" << endl;
cout << " =================================== " <<endl;
cout << " Range Frequency (1 line = 50 occurances)" << endl;
cout << "===================================" << endl;
}