How i find the greatest number from six or more digit number?
<p>thanks in advance,
I have the code in which i want to find out the greatest number from six numbers, the code as follows,</p>

<pre><code>                 if( (pixels-&gt;r == 244 || pixels-&gt;g == 242 || pixels-&gt;b == 245) || (pixels-&gt;r == 236 || pixels-&gt;g == 235 || pixels-&gt;b == 233) || (pixels-&gt;r == 250 || pixels-&gt;g == 249 || pixels-&gt;b == 247) || (pixels-&gt;r == 253 || pixels-&gt;g == 251 || pixels-&gt;b == 230) || (pixels-&gt;r == 253 || pixels-&gt;g == 246 || pixels-&gt;b == 230) ||  (pixels-&gt;r == 254 || pixels-&gt;g == 247 || pixels-&gt;b == 229))  
                {
                    numberOfPixels1++;
                    NSLog( @"Pixel data1 %d", numberOfPixels1);
                }
                if( (pixels-&gt;r == 250 || pixels-&gt;g == 240 || pixels-&gt;b == 239) ||(pixels-&gt;r == 243 || pixels-&gt;g == 234 || pixels-&gt;b == 229) || (pixels-&gt;r == 244 || pixels-&gt;g == 241 || pixels-&gt;b == 234) || (pixels-&gt;r == 251 || pixels-&gt;g == 252 || pixels-&gt;b == 244) || (pixels-&gt;r == 252 || pixels-&gt;g == 248 || pixels-&gt;b == 237) ||  (pixels-&gt;r == 254 || pixels-&gt;g == 246 || pixels-&gt;b == 225))  
                {
                    numberOfPixels2++;
                    NSLog( @"Pixel data2 %d", numberOfPixels2);                 }
                if( (pixels-&gt;r == 255 || pixels-&gt;g == 249 || pixels-&gt;b == 225) ||(pixels-&gt;r == 255 || pixels-&gt;g == 249 || pixels-&gt;b == 225) || (pixels-&gt;r == 241 || pixels-&gt;g == 231 || pixels-&gt;b == 195) || (pixels-&gt;r == 239 || pixels-&gt;g == 226 || pixels-&gt;b == 173) || (pixels-&gt;r == 224 || pixels-&gt;g == 210 || pixels-&gt;b == 147) ||  (pixels-&gt;r == 242 || pixels-&gt;g == 226 || pixels-&gt;b == 151))  
                {
                    numberOfPixels3++;
                    NSLog( @"Pixel data3 %d", numberOfPixels3);
                }

              if( (pixels-&gt;r == 235 || pixels-&gt;g == 214 || pixels-&gt;b == 159) ||(pixels-&gt;r == 235 || pixels-&gt;g == 217 || pixels-&gt;b == 133) || (pixels-&gt;r == 227 || pixels-&gt;g == 196 || pixels-&gt;b == 103) || (pixels-&gt;r == 225 || pixels-&gt;g == 193 || pixels-&gt;b == 106) || (pixels-&gt;r == 223 || pixels-&gt;g == 193 || pixels-&gt;b == 123) ||  (pixels-&gt;r == 222 || pixels-&gt;g == 184 || pixels-&gt;b == 119))  
                {
                    numberOfPixels4++;
                    NSLog( @"Pixel data4 %d", numberOfPixels4);
                }
                if( (pixels-&gt;r == 199 || pixels-&gt;g == 164 || pixels-&gt;b == 100) ||(pixels-&gt;r == 188 || pixels-&gt;g == 151 || pixels-&gt;b == 98) || (pixels-&gt;r == 156 || pixels-&gt;g == 107 || pixels-&gt;b == 67) || (pixels-&gt;r == 142 || pixels-&gt;g == 88 || pixels-&gt;b == 62) || (pixels-&gt;r == 121 || pixels-&gt;g == 77 || pixels-&gt;b == 48) ||  (pixels-&gt;r == 100 || pixels-&gt;g == 49 || pixels-&gt;b == 22))  
                {
                    numberOfPixels5++;
                    NSLog( @"Pixel data5 %d", numberOfPixels5);
                }
                if( (pixels-&gt;r == 101 || pixels-&gt;g == 48 || pixels-&gt;b == 32) ||(pixels-&gt;r == 96 || pixels-&gt;g == 49 || pixels-&gt;b == 33) || (pixels-&gt;r == 87 || pixels-&gt;g == 50 || pixels-&gt;b == 41) || (pixels-&gt;r == 64 || pixels-&gt;g == 32 || pixels-&gt;b == 21) || (pixels-&gt;r == 49 || pixels-&gt;g == 37 || pixels-&gt;b == 41) ||  (pixels-&gt;r == 27 || pixels-&gt;g == 28 || pixels-&gt;b == 46))  
                {
                    numberOfPixels6++;
                    NSLog( @"Pixel data6 %d", numberOfPixels6);
                }
</code></pre>

<p>I have to find out greatest from numberOfPixels1....numberOfPixels6 from above code.
There are any optimum way to find out the greatest number?</p>
