i need explain

I have code it run okay .

but I need explain first what is difference between
int Y and Z

and I need to know how the code run

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
61
62
63
  #include<iostream>
using namespace std;


int main()
{
	int x;
	int y;
	int a[10];
	int z;

	
	for (y = 0; y <= 10; y++)
	{

		cout << "welcome to airlaine resvition system ";
		cout << "\n plase press 1 for first class or 2 for economy class";
		cin >> x;
		do
		{
			
				cout << "Pick a seat in First class ";
				cin >> a[y];
				for (z = 0; z<y; z++) if (a[y] == a[z]) {
					cout << "Seat taken. ";
					
				}
			} while (z != y);
			if (a[y] <= 5)
			{

				cout << "your seats in firs class is " << a[y];

			}
			else
			{
				cout << "wrong number";
			}

			do {
				cout << "Pick a seat in economy class ";
				cin >> a[y];
				for (z = 0; z<y; z++) if (a[y] == a[z]) {
					cout << "\nSeat taken!!! ";

				}
			} while (z != y);
			if (5< a[y] <10 )
			{

				cout << "\nyour seats in firs class is " << a[y];

			}
			else
			{
				cout << "\nwrong number";
			}

		}


	
}
Did you write the code?
no, the code give us to explain ,, I understand all ,but the Z I don't know reason why in this code.
Topic archived. No new replies allowed.