program skipping if/else statments

This program needs to display the integer someone enters as a word.
ex. 43 = plus forty three of -29 = minus twenty nine. It is assumed the user will enter an integer between -20 and -90 or 20 to 90. The program only outputs the minus or plus and skips the rest of the statements. I think I may need curly braces somewhere, but not sure. Can someone help please?

7 #include <iostream>
8 using namespace std;
9
10 int main()
11 {
12
13 int number, msd, lsd;
14
15 msd = number / 10;
16 lsd = number % 10;
17
18 cout << "Enter number: ";
19 cin >> number;
20
21
22 if (number < 0)
23 cout << "minus \n";
24 else
25 cout << "plus \n";
26
27
28 if (msd == 2)
29 cout << " twenty \n";
30 else if (msd == 3)
31 cout << " thirty \n";
32 else if (msd == 4)
33 cout << " forty \n";
34 else if (msd == 5)
35 cout << " fifty \n";
36 else if (msd == 6)
37 cout << " sixty \n";
38 else if (msd == 7)
39 cout << " seventy \n";
40 else if (msd == 8)
41 cout << " eighty \n";
42 else if (msd == 9)
43 cout << " ninety \n";
44
45 if (lsd == 0)
46 cout << " " <<endl;
47 else if (lsd == 1)
48 cout << " one\n";
49 else if (lsd == 2)
50 cout << " two\n";
51 else if (lsd == 3)
52 cout << " three\n";
53 else if (lsd == 4)
54 cout << " four\n";
55 else if (lsd == 5)
56 cout << " five\n";
57 else if (lsd == 6)
58 cout << " six\n";
59 else if (lsd == 7)
60 cout << " seven\n";
61 else if (lsd == 8)
62 cout << " eight\n";
63 else if (lsd == 9)
64 cout << " nine\n";
65
66
67 cout << "PROGRAM ENDS" << endl;
68
69 return 0;
70 }
These two statements:
1
2
msd = number / 10;
lsd = number % 10;

should occur after this statement:
1
2
cout << "Enter number: ";
cin >> number;
Topic archived. No new replies allowed.