Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

second printf should be 42. but its 32766. I think 32766 is stored in array[5]. How can I solve this? I put array[size]=0 but it

image text in transcribed

second printf should be 42. but its 32766. I think 32766 is stored in array[5]. How can I solve this? I put array[size]=0 but it do not work. You should not write any code outside of find_max function.

please help me. you have to use c++

#include using namespace std; int find_max(int *array , int start, int end) int size = sizeof(array) array[size] = 0; int max = array[start]; for(int = / sizeof(int); start ; i max) max array[1]; return max; int mainO int array[] = {42, 23, 6, 28, 10); int n = sizeof(array) / sizeof(int); printf(" Examples of find_max()In" printf("%d ", find, max(array, e, n)); printf("%d ", find, max(array, 1, 2)); printf(%d ", find-max(array, 1, 4)); 327%oples of find.max() 32766 23 28 Program ended with exit code

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data And Databases

Authors: Jeff Mapua

1st Edition

1978502257, 978-1978502253

More Books

Students also viewed these Databases questions