Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int x = 5 / 2 + 1;
- // Switchi
- switch (x) {
- case 2: cout << "-1"; break;
- case 3: cout << "-2"; break;
- case 4: cout << "-3"; break;
- default: cout << "-4"; break;
- }
- // ifi i njejt me switch
- if(x==2)
- {
- cout << "-1";
- } else if(x==3)
- cout << "-2";
- } else if(x==4)
- cout << "-3";
- } else
- {
- cout << "-4";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement