-
What is the output of this program?
#include <iostream>
#include <ctime>
#include <cstdlib>
using namespace std;
int main()
{
srand((unsigned)time(0));
int ran;
int L = 11, H = 100;
int R = (H - L) + 1;
for(int k = 0; k < 1; k++)
{
ran = L + int(R * rand() / (RAND_MAX + 1.0));
cout << ran << endl;
}
}
-
- 100
- 11
- 1.0
- Compilation Error
- None of these
Correct Option: B
In this program, We have generated a certain random number by using the above formula.