How to add more int var into this program
In this programm i added only one int, A,in witch I have to write a combiniations of zeros or ones to it, but what if I want to add something like int A,B, C, D; Each can eather have 1 or 0, how can I write switch command using more int vagiables e.g. A =1 B=0 C=0 D=0 Output: 8 #include <iostream> using namespace std; int main () { int A; cin >> A ; Â switch (A) { Â Â case 0 : cout << "0"; break; Â Â case 1 : cout << "1"; break; Â Â case 10 : cout << "2"; break; Â Â case 11 : cout << "3"; break; Â Â case 100 : cout << "4"; break; Â Â case 101 : cout << "5"; break; Â Â case 110 : cout << "6"; break; Â Â case 111 : cout << "7"; break; Â Â case 1000 : cout << "8"; break; Â Â case 1001 : cout << "9"; break; Â Â case 1010 : cout << "10"; break; Â Â case 1011 : cout << "11"; break; Â Â case 1100 : cout << "12"; break; Â Â case 1101 : cout << "13"; break; Â Â case 1110 : cout << "14"; break; Â Â case 1111 : cout << "15"; break; Â Â Â default : cout << "Error"; Â } Â cout << endl; system("pause"); return 0; }