Monday, May 24, 2010

Wat code/s in an array should i use to determine the lowest number in C?

sort.list





if min%26gt;1 then go to GO SUB





try this, good luck

Wat code/s in an array should i use to determine the lowest number in C?
#include%26lt;stdio.h%26gt;


#include%26lt;conio.h%26gt;


main()


{


int i,n,min;


int a[10];


clrscr();


printf("Enter the size of array = ");


scanf("%d",%26amp;n);


printf("Enter the elements of Array = ");


for(i=0;i%26lt;n;i++)


{


scanf("%d",%26amp;a[i]);


}





/* TO FIND THE LARGEST VALUE WITHIN AN ARRAY*/


min=a[0];


for(i=0;i%26lt;n;i++)


{


if(a[i] %26gt; min)


min=a[i];


}


printf(" Lowest value within an array = %d\n",min);


getch();


}


No comments:

Post a Comment