# unknown problem!

• 09-28-2009
kingdede231
unknown problem!
I am writing a program to calculate the area of shapes i've hit a problem everytime i run the program and input my choice it prints the start again-

Code:

```#include <iostream> using namespace std; int main(){     int choice, w, l;     do{       cout << "Find the Area\n";       cout << "Please enter number of choice(q for quit): \n";       cout << "1. Square\n";       cout << "2. Rectangle\n";       cout << "3. Triangle\n";       cout << "4. Circle\n";       cout << "5. Cube\n";       cin >> choice;       } while ( choice < '1' || choice > '5' && choice != 'q' );             if (choice == 'q') exit(1);             switch (choice){               case '1':                   cout << "\nEnter the width: ";                   cin >> w;                   cout << "\nArea is: " << w*w << "cm2";               case '2':                   cout << "\nEnter the width: ";                   cin >> w;                   cout << "\nEnter the length: ";                   cin >> l;                   cout << "\nArea is: " << w*l << "cm2";               case '3':                   cout << "\nEnter the width: ";                   cin >> w;                   cout << "\nEnter the height: ";                   cin >> l;                   cout << "\nArea is: " << 2/(w*l) << "cm2";               case '4':                   cout << "\nEnter the radius: ";                   cin >> w;                   cout << "\nArea is: " << 3.14*(w*w) << "cm2";               case '5':                   cout << "/nEnter the height: ";                   cin >> l;                   cout << "/nArea is: " << l*l*l << "cm3";                   }               return 0;               }```
Thanks for any help, it is much appreciated.
• 09-28-2009
laserlight
You probably want choice to be a char instead of an int.
• 09-28-2009
quzah
You are mixing up \ and / some of the time. Other than that, when you press 5, what do you do next? Hit enter. It's in the FAQ.

Quzah.
• 09-28-2009
kingdede231
problem fixed thanks