Wednesday, November 3, 2010

Program Name: Minimum value

Program Name: Minimum value

#include
#include
int a[12],j,k,n,i,loc;
void main()
{
clrscr();
printf("\r\n How many elements in Array??");
scanf("\t\t%d",&n);
for(i=1;i<=n;i++)
{
printf("\n\nEnter your value a[%d]= ",i);
scanf("\t%d",&a[i]);
}
loc=1;
j=a[1];
for(k=2;k<=n; k++)
{
if(j>a[k])
{
j=a[k];
loc=k;
}
}
printf("\nYour entered minimum value %d",j);
printf("\nYour minimum location %d in Array",loc);
printf("\n Jabed, E-15, Roll-49");
getch();
}

No comments:

Post a Comment

Simple and Complete E-commerce PL/SQL Code

This is a Database of e-commerce solution. This database is quite simple but complete one.  The script (.sql file) contain all the nece...