Skip to content

Instantly share code, notes, and snippets.

@hrshadhin
Created April 23, 2013 16:12
Show Gist options
  • Save hrshadhin/5444985 to your computer and use it in GitHub Desktop.
Save hrshadhin/5444985 to your computer and use it in GitHub Desktop.
search minimum and maximum value
#include<stdio.h>
int main()
{
int array[7];
int i,j,search,max;
for(i=0;i<7;i++)
{
printf("Enter ur value of [%d]:\n",i);
scanf("%d",&array[i]);
}
max = array[0];
for(j=0;j<7;j++)
{
if (max<array[j])
{
max = array[j];
}
}
printf("Maximum value is %d\n",max);
max = array[0];
for(j=0;j<7;j++)
{
if (max>array[j])
{
max = array[j];
}
}
printf("Mini value is %d\n",max);
return(0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment