Contoh coding nested swicth​

Posted on

Contoh coding nested swicth​

Jawaban:

#include <iostream>

using namespace std;

int main () {

int a = 100;

int b = 200;

switch(a) {

case 100:

cout << "Outer switch" << endl;

switch(b) {

case 200:

cout << "Inner switch" << endl;

}

}

cout << "Basil B : " << a << endl;

cout << "Hasil A : " << b << endl;

return 0;

}