Re: [Flashcoders] there is a problem plz help

2007-04-24 Thread Petrus Rademeyer
you check if the arr[i] is greater than greater and then you increment i rather do for(int i=0; i15;i++){ if(arr[i]greater){ greater=arr[i]; } } :) Waseem Shahzad wrote: /* to find greater no. from the array whats the problem with this algo. please help */ #includeiostream.h

Re: [Flashcoders] there is a problem plz help

2007-04-24 Thread Claus Wahlers
to find greater no. from the array whats the problem with this algo. please help int arr[15]={17,2,3,4,5,6,7,8,9,10,11,12,13,14,15}; int greater=0; for(int i=0; i15;){ if(arr[i++]greater){ greater=arr[i]; } } First of all, it's C. Second, try incrementing i inside the for statement,

Re: [Flashcoders] there is a problem plz help

2007-04-24 Thread Sherif Elshazly
Sent: Tuesday, April 24, 2007 11:51:18 AM Subject: Re: [Flashcoders] there is a problem plz help Hello, is this better ? var arr:Array = [17,2,3,4,5,6,7,8,9,10,11,12,13,14,15]; var greater:Number = 0; for(var i:Number = 0; i arr.length; i++){ greater = Math.max(greater,arr[i]); } trace

Re: [Flashcoders] there is a problem plz help

2007-04-24 Thread opto-type
++){ greater = Math.max(greater,arr[i]); } trace(greater is + greater + \n); Sherif - Original Message From: Gilles Roquefeuil [EMAIL PROTECTED] To: flashcoders@chattyfig.figleaf.com Sent: Tuesday, April 24, 2007 11:51:18 AM Subject: Re: [Flashcoders] there is a problem plz help Hello

Re: [Flashcoders] there is a problem plz help

2007-04-24 Thread Waseem Shahzad
24, 2007 11:51:18 AM Subject: Re: [Flashcoders] there is a problem plz help Hello, is this better ? var arr:Array = [17,2,3,4,5,6,7,8,9,10,11,12,13,14,15]; var greater:Number = 0; for(var i:Number = 0; i arr.length; i++){ greater = Math.max(greater,arr[i]); } trace(greater

Re: [Flashcoders] there is a problem plz help

2007-04-24 Thread Waseem Shahzad
: Gilles Roquefeuil [EMAIL PROTECTED] To: flashcoders@chattyfig.figleaf.com Sent: Tuesday, April 24, 2007 11:51:18 AM Subject: Re: [Flashcoders] there is a problem plz help Hello, is this better ? var arr:Array = [17,2,3,4,5,6,7,8,9,10,11,12,13,14,15]; var greater:Number = 0; for(var i:Number = 0