We are supposed to create a program that accepts 15 telephone numbers. All numbers consist of 8 digits. Fixed lines start with 17 and mobile lines start with 39. Prog should cout the number of fixed and mobile lines.
Also, prog should stop when the user enters a negative number.

Here is my code:

```
#include <iostream>
using namespace std;
void main ()
{

int n, c=1, cm=0, cf=0;

cout << "Enter a telephone number or enter a negative number to stop ";

while (c <= 15){
    cin >> n;

    if (n/1000000 == 39){
        c++;
        cm++;
    }

    else if (n/1000000 == 17){
        c++;
        cf++;
    }

    else cout << "Wrong telephone number" << endl;

    cout << "Enter the next telephone number or enter a negative number to stop ";
    cin >> n;

}

cout << "The number of fixed lines is " << cf << endl;
cout << "The number of mobile lines is " << cm << endl;

system ("PAUSE");

```

}

I have two problems:

1. I don't know how to end the program when the user enters a negative number.
2. Program doesn't cout "Enter the next telephone number or enter a negative number to stop " after entering the second number.