Loading...
Engaged Employer
Find the first and second maximum of an array in one loop
Anonymous
I gave them the code
int max=arr[0]; int smax=max; int flag=0; for(int i=0;imax){ flag=1; } if(flag==1) { smax=max; max=arr[i]; flag=0; } }
Check out your Company Bowl for anonymous work chats.
Get actionable career advice tailored to you by joining more bowls.
Stay ahead in opportunities and insider tips by following your dream companies.
Get personalized job recommendations and updates by starting your searches.