#include<stdio.h> #include<conio.h> void main() { int n,i,a[10],max,min; clrscr(); printf("Enter the n value"); scanf("%d",&n); for(i=1;i<=n;i++) { printf("Enter the a[%d]=",i); scanf("%d",&a[i]); } max=0; for(i=1;i<=n;i++) { if(a[i]>max) { max=a[i]; } if(a[i]<min) { min=a[i]; } } printf("maximum is =%d",max); printf("minimum is=%d",min); getch(); } |