5 plus 5 is a precise question, and the asnwer to it is 10. It does not have a random answer.
55
The following is the correct answer.39.5However, because of randomness, the answer might change between my typing it and your seeing it!
No.
8
Note that the reason there exists a technique called multiplication is so that we do not have to perform tedious and lengthy series of addition such as the one you have presented. So, you have given us 24 of the number 5 to add. 24 x 5 = 120. (Addition form) 5 + 5 + 5 + 5 + 5 + 5 + 5 + 5 + 5 + 5 + 5 + 5 + 5 + 5 + 5 + 5 + 5 + 5 + 5 + 5 + 5 + 5 + 5 + 5 = 120
Thirty
5 + 5 + 5 + 5 + 5 + 5 + 5 + 5 + 5 + 5 + 5 = 55
77
5 + 5 + 5 + 5 + 5 + 5 = 30
4 + 6 + 6 + 5 + 5 + 4 + 6 + 5 + 5 + 6 + 5 + 5 + 5 + 3 = 70
5 + 5 + 5 + 5 + 5 + 5 + 5 + 5 + 5 = 45, the shorter version is 5*9.
Random numbers can be generated by a pseudo-random number generator. As of C++11, the standard library provides several generators in the <random> header. The following demonstrates how to simulate 10 throws of a die. #include <random> #include <iostream> int main (void) { std::default_random_engine gen; std::uniform_int_distribution<> dist {1, 6}; // range of distribution [1:6] for (int n=0; n<10; ++n) std::cout << dist(gen) << ' '; std::cout << '\n'; } Example output: 1 1 6 5 2 2 5 5 6 2