Source Code - dpp/source/switch2.dpp
Download link (right click, save as)
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
|
function main()
{
newvar z;
screenput "Enter a number: ";
screenin z; screen; screen;
switch z;
case 1, 3, 5:
screenput "It's odd!";
case 2, 4, 6:
screenput "It's even!";
default:
screenput "wtf is that?";
endswitch;
}
|
This code is Copyright (C) 2000-2012 PageMac Programming. Reproduction of this code must adhere to the GNU General Public License.