Code:
#include <iostream.h>
#include "apvector.h"
int main()
{
apvector <int>num(6,0 );
apvector <int>page(6,0 );
apvector <int>temp(6,0 );
int cnt=0, len=0, x, p=0;
for (x=0; x<6; x++)
{
len = 0;
cout << "\nEnter page Number:";
cin >> num[x];
if (num[x] < 0)
break;
do {
num[x] = num[x]/10;
len++;
} while (num[x] > 0);
temp[x] = len;
cnt++;
}
}
The program is suppose to output:
123
136
139
1001
1021
1100
if the user enter numbers:
123
36
9
1001
1021
1100
The above code is incomplete: cant figure a way of adding em.
AP CLASS folder has been included