my zipcode

i solved my previous problem but in order to create 10 different zipcode where should i put the loop I tried put loop at every function it does not work and I tried put under the main method it create exactly 10 same zipcode here is my coding only create one zipcode
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <ctime>
#include <cmath>

using namespace std;

class Zipcode
{
public:
    Zipcode();

    void createZipcode();
    int getZipcode();

private:
    int zipcode;
    int d;


};
Zipcode::Zipcode()
{
zipcode =0;
createZipcode();



}

void Zipcode::createZipcode()
{



zipcode = 10000 + rand() %99999;

}

int Zipcode::getZipcode()
{



  return zipcode;


}

int main()
{
 Zipcode  zip;

cout << zip.getZipcode() << endl;


}

Topic archived. No new replies allowed.