Prepare for your Next Interview
|
Welcome to the Geeks Talk forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
This is a discussion on How many Case statments can i use in Switch Statement within the C and C++ forums, part of the Software Development category; Question asked by Visitor rasool If i use "switch" statement how many "case" statments can i use ex :- int n; cout<<"enter the choice"; cin>>n; switch (n) case 1:cout<<"one"; break; ...
|
|||||||
|
|||
|
How many Case statments can i use in Switch Statement
Question asked by Visitor rasool
If i use "switch" statement how many "case" statments can i use ex :- int n; cout<<"enter the choice"; cin>>n; switch (n) case 1:cout<<"one"; break; case 2:cout<<"two"; break; ----- ----- ----- like this how many case statement I can use in C & C++ |
| Sponsored Links |
|
|||
|
Re: How many Case statments can i use in Switch Statement
I think there is no restriction on the number of Case statements.
__________________
Lack of WILL POWER has caused more failure than lack of INTELLIGENCE or ABILITY. -sutnarcha- |
|
|||
|
Re: How many Case statments can i use in Switch Statement
hai..
there is no limit in the cases in the switch. the only limitation is that they should not have same cases twices. |
|
|||
|
Re: How many Case statments can i use in Switch Statement
No limit is defined in the standard, however, it depends on the size of the int. If int is 32 bits then the limit is 2^32-1. But that is not practical given system resources.
|
|
|||
|
Re: How many Case statments can i use in Switch Statement
HI
how do u know the max limit is 257? Yo got this information from any book or any from other source. |
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Use case statement and Test Case | JobHelper | Testing Issues | 4 | 01-16-2009 03:48 AM |
| Is this a correct statement | anoop4real | C and C++ | 13 | 05-22-2008 07:22 AM |
| C/C++ Programming : Limitations of switch statement | Lokesh M | C and C++ | 1 | 07-17-2007 03:38 AM |
| find the correct switch..... | psuresh1982 | Brainteasers | 7 | 02-08-2007 04:57 AM |
| Vlan on layer 3 switch | nikhil_rattan | Networking | 2 | 01-18-2007 02:33 AM |