Monday, May 24, 2010

Can i get a C program for finding greatest and smallest numbers among an array of numbers?

If you have an int array called A with a range of 100 (A[100]):





int i;





int Smallest;





int Largest;





Smallest=A[0];


Largest=A[0];











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


{


if A[i]%26gt;Largest


{


Largest=A[i];


}





if A[i]%26lt;Smallest


{


Smallest=A[i];


}





}





You should probably do your own homework, you know...Yahoo Answers won't be available when you're taking a test in the classroom!

Can i get a C program for finding greatest and smallest numbers among an array of numbers?
Yes you can get the C program.


No comments:

Post a Comment