Ask your own question, for FREE!
Computer Science 11 Online
OpenStudy (anonymous):

Write a program in which you create an array of 10 integer elements. Write a procedure, that gets the array, and the addresses of two variables as parameters. After calling the procedure the two variables may contain the smallest and the largest element of the array.

OpenStudy (anonymous):

//done in c++ public void assign(int a[], int *small, int *large) { *(small)=a[0]; *(large)=a[0]; for (int i=1;i<10;i++) { if(a[i]<*(small)) *(small)=a[i]; else if (a[i]>*(large)) *(large)=a[i]; } }

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!