C Saved Program: gifted-city



Here's the online compiler accompanied with IDE at your service. This is a saved code by one of our users. Try it out or save your own from the IDE page and don't forget to leave a feedback. You can find that at the bottom of the page.


#include<stdio.h>
int array[]={5,1,9,1,4,6,3,7,0,2};
int i=0, largest;
int main()
{
   largest=array[0]; 
 for(i=1; i<9; i++)
 {
  if(largest<array[i])
  {
     largest=array[i];
  }
 }
 printf("%d", array[i]);
}
 /*for(i=0; i<9; i++)
 {
  if(array[i]<array[k] && array[i]>=array[i-1]) 
  {
      s=i;
      
  }
 }
 for(i=0; i<9; i++)
 {
  if(array[i]<array[k] && array[i]>=array[i+1]) 
  {
      r=i;
      
  }
 }
 if(r>s)
 {
   printf("%d\n", array[r]);
 }
 else if(r<s)
 {
     printf("%d\n", array[s]);
 }
}*/
Execute