c++ switch multiple cases

#include <iostream> 
using namespace std; 
  
int main() { 
    // variable declaration 
	int input;
	switch(input){
	case 1: case 2: case 3: case 4:
		//executes if input is 1, 2, 3, or 4
		break;
	case 5: case 6: case 7:
		//executes if input is 5, 6, or 7
        break;
	default:
		//executes if input isn't any of the cases
    }
    return 0; 
} 

Are there any code examples left?
Create a Free Account
Unlock the power of data and AI by diving into Python, ChatGPT, SQL, Power BI, and beyond.
Sign up
Develop soft skills on BrainApps
Complete the IQ Test
Relative searches
switch case with multiple statements in each case in c++ switch statement c++ same case 2 switch case c++ more than one value c++ switch case multiple lines two cases in one switch statement c++ how to add multipual case name in switch c++ switch case c++ multiple arguments how to add multiple case in c++ how to add two switch cases in c++ multiple switch case in c++ c++ case multiple values switch case multiple statements c++ how to use multiple switch case in c++ c++ switch case having more than one value c++ switch case 2 values 2 case in one statement in c++ switch multiple values in switch case c+ c++ multiple case statements c++ switch case with multiple values execute multiple statements in c++ switch multiple case statements c++ c++ multible switch case how to use two switch in switch case cpp how to use two conditions in switch case cpp multiple switch statements c++ switch con case multipli c++ c++ switch statement multiple conditions switch statement c++ 2 cases in one two cases in one line switch c++ c++ switch case multiple vlaues c++ switch case multiple conditions c++ switch multiple case values same condition for multiple switch case in c++ c++ case with multiple values &amp; c++ case with multiple values how to apply switch case in c++ switch case c++ switch example in c++ switch statements c++ c++ switch multiple case cpp case 1 or 2 c++ multi case switch case cpp number of same casees switch case with multiplu cases c++ multi case switch in c++ switch multiple case c++ switch case same code for 2 cases cpp c++ switch case multiple values cpp switch case multiple ++ switch multiple cases multiple cases same code c++ double case c++ c++ switch multiple cases
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source