Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

How do I compile this program? #include #include using namespace std; long long NcR(int n, int r) { if(r > n - r) r =

How do I compile this program?

#include #include using namespace std; long long NcR(int n, int r) { if(r > n - r) r = n - r; // because C(n, r) == C(n, n - r) long long ans = 1; int i; for(i = 1; i <= r; i++) { ans *= n - r + i; ans /= i; } return ans; }

int main() { random_device rd; mt19937 gen(rd()); uniform_int_distribution<> dis(1, 100); int nob,rov,ticket,temp,values[70][7]; do { cout<<" Enter the number of balls or numbers you wish to pick from. The number must be between 3 and 7 : "; cin>>nob; } while(nob<3||nob>7); do { cout<<" Enter the largest number in the lottery. The number must be between 45 - 70 : "; cin>>rov; } while(rov<45||rov>70); do { cout<<" Enter the number of tickets you want. The number must be between 1 - 100 : "; cin>>ticket; }while(ticket<1||ticket>100); for(int i=0;i dis(1, rov); for(int j=0;j

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions