|
|
//declare constant integers min = 0, max = 200, N = 20 //declare the integer variables: //random_number, largest = 0, smallest = 200, sum = 0, count //use srand (time(NULL)) function to ensure that your program will generate different //sequences each time it runs //start a for() loop where count = 0; count < 20; count ++ //within the loop perform the following: // Use function rand() and an appropriate formula to generate a random value // Assign the random value to rand_number // Display the value on the screen // Add rand_number to the sum ( sum = sum + rand_number) // If rand_number > largest, re-assign largest = rand_number // If rand_number < smallest, re-assign smallest = rand_number //When the loop is completed display largest, smallest values and compute //and display the average |
|
|
std::cin.ignore(std::numeric_limit<std::streamsize>::max(), '\n');
#include <limits>
database on top
Thanks very much bluezor but i have 1 small problem with the std::cin.ignore(std::numeric_limit<std::streamsize>::max(), '\n'); It says numeric_limit' is not a member of `std' and i have double check that i am running #include <limits> database on top |
using namespace std;
. If you are using that just cut off the std::
off, then it should work.Why do you always post complete solutions? |