Thread: switch() case 1: Question

  1. #1
    Registered User Zero_X's Avatar
    Join Date
    Mar 2006
    Posts
    19

    switch() case 1: Question

    ok i fixed it now guys, sorry about that. i was trying to put the if() statement before the case 3:... i switched it to inside of the case 3: and it worked fine.
    Code:
    cout<<"1) Option-A\n";
    cout<<"2) Option-B\n";
    cout<<"3) Option-C\n";
    cout<<"Selection: ";
    int x;
    cin>>x;
    switch(x){
                   case 1:
                            cout<<"You Selected A\n";
                            break;
                   case 2:
                            cout<<"You Selected B\n";
                            break;
                   case 3:
                           cout<<"You Selected C\n";
                           break;
                  }
    Last edited by Zero_X; 04-18-2006 at 12:43 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 5
    Last Post: 03-05-2009, 11:32 AM
  2. switch case statement
    By stanlvw in forum C++ Programming
    Replies: 3
    Last Post: 02-26-2008, 05:06 AM
  3. Replies: 27
    Last Post: 10-11-2006, 04:27 AM
  4. Binary Search Trees Part III
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 10-02-2004, 03:00 PM
  5. Changing bkgrnd color of Child windows
    By cMADsc in forum Windows Programming
    Replies: 11
    Last Post: 09-10-2002, 11:21 PM