- Code: Select all
if(variable==0)
{
variable=1;
//insert other code here
}
else if(variable==1)
{
variable=2;
//insert other code here
}
...
else
{
//default code here
}
Or the switch function
- Code: Select all
switch(variable)
{
case 0:
variable=1;
//other code here
break;
case 1:
variable=2;
//other code here
break;
...
default:
//default code here
}