Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

#include using namespace std; const int SIZE = 10; void displayGreaterThan( int [], int ); void displaySmallerThan( int [], int ); void displayArrayContent( int []);

#include

using namespace std;

const int SIZE = 10;

void displayGreaterThan(int[], int);

void displaySmallerThan(int[],int);

void displayArrayContent(int[]);

void displayLargestValue(int[]);

void displaySmallestValue(int[]);

int main(){

int number;

int numbers[SIZE] = {9,1,90,98,53,22,76,29,37,65};

cout <<"Enter a number: ";

cin >> number;

cout << endl;

displayGreaterThan(numbers,number);

cout << endl;

displaySmallerThan(numbers,number);

cout << endl;

displayArrayContent(numbers);

cout << endl;

displayLargestValue(numbers);

cout << endl;

displaySmallestValue(numbers);

cout << endl;

return 0;

}

void displayGreaterThan(int value[],int num){

cout << " All larger value(s)than" << num << ":" << endl;

for(int index = 0;index < SIZE;index++){

if(value[index] < num){

cout << value[index] << "";

}

}

//cout << " All larger value(s)than" << num << ":" << endl;

}

void displaySmallThan(int value[], int num){

cout << " All Smaller value(s)than" << num << ":" << endl;

for(int index = 0; index < SIZE; index++){

if(value[index] < num){

cout << value[index] << "";

}

}

//cout << " All Smaller value(s)than" << num << ":" << endl;

}

void displayArrayContent(int values[]){

for(int index = 0; index < SIZE; index++){

cout << values[index] << "" << endl;

}

}

void displayLargestValue(int values[]){

int num = values[0];

for(int index = 0; index > SIZE; index++){

if(values[index] > num){

num = values[index];

}

}

cout << " Largest value in array is " << num << endl;

}

void displaySmallestValue(int values[]){

int num = values[0];

for(int index = 0; index < SIZE; index++){

if(values[index] < num){

num = values[0];

}

}

cout << " Smallest value in array is " << num << endl;

}

Can someone tell me what happening to my c++ program? It keep telling me build fail.

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

Modern Database Management

Authors: Jeffrey A. Hoffer Fred R. McFadden

4th Edition

0805360476, 978-0805360479

More Books

Students also viewed these Databases questions

Question

Why do mergers and acquisitions have such an impact on employees?

Answered: 1 week ago

Question

2. Describe the functions of communication

Answered: 1 week ago