Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ why is it giving me a weird number ? and incorrect min value? #include #include using namespace std; void printArray(int array[], int n) {

C++

why is it giving me a weird number ? and incorrect min value?

#include

#include

using namespace std;

void printArray(int array[], int n) {

for (int i = 0; i

cout

}

}

int getSmall(int array[], int n) {

int min = array[0];

for (int i = 0; i

if (array[i] > 0 && (array[i]

min = array[i];

}

if (min

min = 0;

}

return min;

}

int main()

{

int array[25];

cout

int n;

cin >> n;

cout

for (int i = 0; i

cin >> n;

}

cout

printArray(array, n);

cout

system("PAUSE");

}

image text in transcribed

TXSource.cpp X CAUsers josh\Documents Visual Studio 2017\Projects arrays\Debuglarrays.exe Enter number of integers: box no us Enter 4 integers n this g1 2 3 4 em on The contents of the array are -858993460The smallest number is dd it toPress any key to continue . . - lbox

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

More Books

Students also viewed these Databases questions