answersLogoWhite

0


Best Answer

int findMax(int *array)

{

int max = array[0];

for(int i = 1; i < array.length(); i++)

{

if(array[i] > max)

max = array[i]

}

return max;

}

User Avatar

Wiki User

15y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Write a c program to find the maximum value of 25 element in an array?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Write c program to find median?

If you are using an array : sort using qsort() then take middle element.


Write a c program to find the maximum of two numbers and print out with its position?

maxValue = function (array) {mxm = array[0];for (i=0; i&lt;array.length; i++) {if (array[i]&gt;mxm) {mxm = array[i];}}return mxm;}; i don't know


How are arrays processed?

Usually one element at a time. If you want to process all elements of an array, you write a loop.Usually one element at a time. If you want to process all elements of an array, you write a loop.Usually one element at a time. If you want to process all elements of an array, you write a loop.Usually one element at a time. If you want to process all elements of an array, you write a loop.


How do you write a program which reads a list of ten numbers and print the list in reserve order in c program?

The simplest way is probably to read the numbers into an array and then prints each element of the array starting at the last one and moving backwards.


Write a program in c to find the largest no out of a matrix of order mn?

/* using ellipses (...) to indicate tabs for clarity */ double largest (double *array, int M, int N) { ... int i, j; ... double *element; ... double answer = array[0][0]; ... for (i=0; i&lt;M; i++) { ... ... for (j=0; j&lt;N; j++) { ... ... ... element = array + i*M + j; ... ... ... if (*element &gt; answer) answer = *element; ... ... } ... } ... return answer; }


Write a program to find out the address of an element in an array?

== Java does not allow reference to memory locations. == In C: for (i=0; i&lt;n; ++i) printf ("a[%d] is at %p\n", i, &amp;a[i]);


What will happen if you try to write to an array element larger than your array?

The results of that programming error is undefined. You must NEVER EVER write, or EVEN READ an array element beyond the allocated size of the array. Period.I would flunk a student that consistently did this, and I would fire a programmer that did the same.


Write a java program to print the result in the series?

If you have the series stored in an array, you loop through the array and print each array element in turn. Another possibility is to print out the numbers in the series as you generate them. In that case, you may not need to store anything (depending on the series, of course).


Write an Algorithm to delete a last element from the array?

// Assuming you dynamically allocated this array using "new"... delete array[arraysize - 1]; arraysize--;


Write a function in c that returns the largest value stored in an array-of-int Test the function in a simple program?

int max(int arr[], int arrSize){int maximum = arr[0];for (int i = 0; i < arrSize; i++){if (maximum < arr[i]){maximum = arr;}}return maximum;}


How do you write a C Program to fill up an Integer Array?

Reference:cprogramming-bd.com/c_page1.aspx# array programming


Could you Write a program for 8086 microprocessor that displays on the monitor the average of 2 numbers from an array?

How to write a program for mouse in microprocessor?