c++ switch
switch(expression) {
case x:
// code block
break;
case y:
// code block
break;
default:
// code block
}
c++ switch
switch(expression) {
case x:
// code block
break;
case y:
// code block
break;
default:
// code block
}
how to make a switch case statement in c++
#include <iostream>
using namespace std;
int main(){
int num = 5;
switch(num + 2) {
case 1:
cout << "Case1: Value is: " << num << endl;
case 2:
cout << "Case2: Value is: " << num << endl;
case 3:
cout << "Case3: Value is: " << num << endl;
default:
cout << "Default: Value is: " << num << endl;
}
return 0;
}
switch cpp
#include<iostream>
using namespace std;
int main(){
switch(<espressione>){
case <costante x>:
// Istruzioni
break;
case <costante y>:
// Istruzioni
break;
case <costante z>:
// Istruzioni
break;
............
default:
// Istruzioni
break;
}
}
switch c++
switch(expression) {
case x:
// code block
break;
case y:
// code block
break;
default:
// code block
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us