Answers for "largest element in arrray"

0

largest element in arrray

#include <stdio.h>

int main() {
   int array[10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 0};
   int loop, largest;

   largest = array[0];
   
   for(loop = 1; loop < 10; loop++) {
      if( largest < array[loop] ) 
         largest = array[loop];
   }
   
   printf("Largest element of array is %d", largest);   
   
   return 0;
}
Posted by: Guest on September-14-2021

Code answers related to "largest element in arrray"

Browse Popular Code Answers by Language