//Read n nos & read the min & max using 2 functions
//Downloaded from www.c4cprog.co.nr
#include<conio.h>
int maximum(int p)
{
int max;
max=p;
return(max);
}
int minimum(int p)
{
int min;
min=p;
return(min);
}
void main()
{
int n,min,max,p=0,i,k=0;
clrscr();
printf("Enter The Limit :");
scanf("%d",&n);
max=0;
min=31000;
printf("Enter The Nos :");
for(i=0;i<n;i++)
{
scanf("%d",&p);
if((p<0)&&(i==1))
{max=p;}
if(p>max)
max = maximum(p);
if(p<min)
min = minimum(p);
}
printf("\nMaximum Of Nos = %d\nMinimum Of Nos = %d",max,min);
getch();
}
Programs Can Also Be Downloaded From The Folders Below....[Or Scroll Down]
Min & Max of a set of nos. using Functions
Click Here To Download C File Of This Program
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment