You can use the way KaangaRoo has shown or if the decision depends only on the integer u will be interested using Switch-case Statement.
e.g.
Switch (integer)
{
case 1:{.
.
code
.
}
case 2:{.
.
code
}
//like that
default:{
code
}
}
upon the values the integer takes the code will be executed. If integer doesn't take any value u have accounted for, default code is executed
Main Topics
Browse All Topics





by: KangaRooPosted on 2000-03-13 at 08:36:00ID: 2612898
int i = something;
if( i == 1)
/* do something */;
else if( i == 2 )
/* do something else */;
else if( i == 3 )
/* do something completely different */;
else
/* out of idea's ;) */;