I might add also that the same thing is possible using IF's, select case is always more effcient though however.
Notice how we start with the smallest number first? Always start with the smallest value first and work downwards with the next biggest value.Code:for (int i = 0; i < 12; i++) { sample = tempArray[i]; if (sample < 0) rangeA++; else if (sample < 10) rangeB++; else if (sample < 20) rangeC++; else if (sample < 30) rangeD++; else rangeE++; }
Hope it helps
Trent Jackson
Bookmarks