Skip to main content

  | मौसम…

411 समाचार
Public archive edition · Attributed source reporting with original dates · AI drafts are excluded

411 REFERENCE · Wikibooks

Algorithms/Find maximum/c method 1

Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.

c source code int findmax(const int a[], int len) { int curr_max, i; if(len == 1) return a[0]; else if(len == 0) return 0; curr_max = a[0]; for(i = 1; i < len; i++) if(a[i] > curr_max) curr_max = a[i]; return curr_max; }