Hi fellow forumers...I am new to this forum and programming.
Regarding the above topic..Is there and code that solves this sort of question?

My question:A program that input 10 integers and find the largest value.

Thanks very much!

3
Contributors
4
Replies
9
Views
8 Years
Discussion Span
Last Post by Fbody

Hello.
I'm new here, too, but I have read the site rules. You're supposed to show an effort before the site's members will help you.

But the answer to your question is yes, there is code to solve that problem.

I'd get user input, put their numbers into an array and then check each number in the array. Or you could use a vector, I guess.

What code have you written so far?

Edited by MyrtleTurtle: n/a

rule followers are good :)

Depending on the rest of the requirements for the assignment, it can actually be done more simply than that.

I'm going to let the OP stew on it for a little while though.

Hello.
I'm new here, too, but I have read the site rules. You're supposed to show an effort before the site's members will help you.

But the answer to your question is yes, there is code to solve that problem.

I'd get user input, put their numbers into an array and then check each number in the array. Or you could use a vector, I guess.

What code have you written so far?

I see...Really sorry if I have neglected the rules..
This was ask by my lecturer and I couldnt solve it after sitting there for hours..And she told me, Its a code that I havent teach yet...

here's the part that I managed to work out:

``````#include <iostream>
using namespace std;
int main()

{
int x,number;
for (x=1,x<=10,x++)
{
cin>>number;``````

I did till this part. Then I think I need to input some sort of code using if else code? or the so called max code by my lecturer....?

fybody: whats OP?

Edited by WaltP: for being sorry you neglected the rules, maybe you should have actually READ them!

fybody: whats OP?

OP = Original Post/Poster