find out

i dont understand this flow. anyone would help to find out this solution?

1. write a program to input 5 integar numbers. after the data have been entered, make the program to display the numbers.
2. modify the programs so that the numbers displayed will be double from the original values.
3. modify the program to find the smallest number in the array
4. modify the program so that after display the lowest value, the program will also display the sum of all the values.
"flow" ? Post some code of what you did so far so that others can help you with specific issues. Simplest data structure to use here would be a vector<int>
Hello lhamfi95,

The instructions are easy to follow.

1. Get five numbers from the keyboard. The end of step 3 says they will be stored in an array. Or I agree with icy1 put them in a vector unless you are stuck with arrays and that is OK. The last part, and I would write a function for this, is to display the numbers in the array. There are three parts here and I would work on them first.

Here is a suggestion of how you could start the program:
1
2
3
4
5
6
7
8
9
10
11
12
#include <iostream>

constxpr std::size_t MAXSIZE{ 5 };

int main()
{
	int numbers[MAXSIZE]{};

        //  Your code here.

	return 0;
}  //  End of main 


For me "size_t" is another name for "unsigned int" because an array size can not be a negative number. I do not think it is, but it might be, specific to Microsoft.

Hope that helps,

Andy

Edit:
Last edited on
Topic archived. No new replies allowed.