Answer to Question #69476 in C++ for James

Question #69476
C++ program using arrays that asks the user to type 10 integers and writes the smallest value.
1
Expert's answer
2017-08-08T06:51:45-0400
Asnwer:
#include <iostream>
using namespace std;

int main(void)
{
int array[10];

for(int i=0; i<10; i++)
{
cout << "Enter integer number: ";
cin >> array[i];
}

int smallestValue = array[0];
for(int i=1; i<10; i++)
{
if (smallestValue > array[i])
smallestValue = array[i];
}

cout << endl << "Smallest value: " << smallestValue << endl;

return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS