Hello, I am new to C and this forum. I am currently attending school for my ASCS. I have an assignment for my programming class that I could use some help with. I figured out the code, although I didn't write it; I was hoping someone could help me make sense of it all. I only have class once a week for a couple hours, so it hasn't quite sunk in yet.
Any help is greatly appreciated. Thanks.Code:#include <stdio.h>
int largest(int array[10]);
int main()
{
int array[10];
int i = 0;
int biggest;
while(i < 10)
{
array[i] = rand() % 100;
printf("%d\n", array[i]);
i++;
}
biggest = largest(array);
printf("the largest number is %d\n", biggest);
system("PAUSE");
return 0;
}
int largest(int array[10])
{
int i = 1;
int largest;
largest = array[0];
while(i < 10)
{
if(largest < array[i])
{
largest = array[i];
}
i++;
}
return largest;
}
-Sean

