2
Contributors
3
Replies
4
Views
7 Years
Discussion Span
Last Post by Dave Sinkula
0
#include <iostream>

using namespace std;

int main()
{	
	double randomMax = 0.0;
	int rand_max = rand();

	//calculate rand_max
	randomMax = 0 + rand_max;

	//display the value of the RAND_MAX constant
	cout << randomMax << endl;


    return 0;
}   //end of main function
0

The problem is I'm only getting 41 as the number, which I know isn't correct.

2
#include <iostream>
#include <cmath>
using namespace std;

int main()
{
   cout << "RAND_MAX = " << RAND_MAX << "\n";
   return 0;
}
Votes + Comments
Smart Guy, knows how to use google.
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.