Search C Program | nimishsoft@gmail.com

Maximum value of Array

/* Maximum value of Array */
 
#include<stdio.h>

int main()
{
 int arr[10],i,max=0;
 printf("Please enter 10 values:\n");
 for(i=0;i<10;i++)
  scanf("%d",&arr[i]);
 
 max=arr[0];
 for(i=1;i<10;i++)
 {
  if(max<arr[i])
   max=arr[i];
 }
 
 printf("Maximum value of Array: %d",max);
 return 0;
}


Related Posts:
-------------------------------------------------------------
Minimum value of Array
http://cbasicprogram.blogspot.in/2012/05/minimum-value-of-array.html

1 comment: