Created
April 23, 2013 16:12
-
-
Save hrshadhin/5444985 to your computer and use it in GitHub Desktop.
search minimum and maximum value
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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