1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Olin [163]
3 years ago
9

Write a program LotheryPrinter that picks a combination in a lottery. In this lottery, players can choose 6 numbers ( possibly r

epeated) between 1 and 50. (
Computers and Technology
1 answer:
Damm [24]3 years ago
3 0

Answer:

#include <bits/stdc++.h>

using namespace std;

void LotheryPrinter(int number[])

{

   int a=1000;

   srand(time(0));//for generating different number on each program execution..

   while(a>50)

   {

       a=rand();//generating lottery number between 1 to 50...

   }

   cout<<a<<endl;//printing the lottery number..

   bool lottery=false;

   for(int i=0;i<6;i++)

   {

       if(number[i]==a)//finding that user has won the lottery or not..

       {

           cout<<"You have won the lottery"<<endl;

           lottery=true;

           break;

       }

   }

   if(!lottery)

   cout<<"Sorry try other time"<<endl;

}

int main() {

  int number[6];//array of integers of size 6..

  cout<<"Choose 6 numbers between 1 to 50"<<endl;

  for(int i=0;i<6;i++)

  cin>>number[i];

  LotheryPrinter(number);//calling the function..

return 0;

}

Output:-

Choose 6 numbers between 1 to 50

5 20 12 45 10 36

33

Sorry try other time

Explanation:

I have created a function called LotheryPrinter to generate a lottery number and and then matching the lottery number with the numbers entered by the user and all the number are between 1 to 50.

You might be interested in
Which part of the cpu accepts data?
V125BC [204]

The answer is the Processor register.

5 0
3 years ago
In 1–2 sentences describe the purpose of comparison operators and give an example.
love history [14]
Comparison operators are used to compare between objects!
are they equal?  is one greater than the other?

if (a == b) ++a;
if (a > b) a = b;

for example when we use a sort function, comparison operators are used inside the function.

7 0
3 years ago
List &amp; briefly explain 5 benefits of having a Business bank account.
oee [108]

Answer:  down there

Explanation:

Some other benefits come from establishing a business bank account. You can gain access to services that make life easier, such as merchant account and payroll services, free online banking and, importantly, easier access to small business loans.

3 0
3 years ago
Read 2 more answers
Consider the operation of deleting the root of a binary search tree. if the root has one child, then ________.
PSYCHO15rus [73]

The reference to the root of the tree should be set to null

<h3>Can the root of a binary tree be null?</h3>
  • Only the subtrees are nulled out, the root always remains and will never be set to null.
<h3>What is null root?</h3>
  • null-, root. -null- comes from Latin, where it has the meaning "none; not one.
  • '' This meaning is found in such words as: annul, null, nullify.

To learn more about it, refer

to brainly.com/question/24448358

#SPJ4

4 0
2 years ago
Which answer best describes an unsubsidized federal loan?
soldi70 [24.7K]

The answer is you are responsible for paying all the interest that accumulates on your loan. <span>For unsubsidized loans, the interest accumulates while you are in school, and 6 months after you graduate (or drop out) you will start paying on your loans. </span>

6 0
3 years ago
Other questions:
  • Page _____ refers to whether a page is laid out vertically or horizontally.
    12·1 answer
  • She thinks it is a good idea to list the gasses bass ed on the the gas found in the atmosphere ...
    12·1 answer
  • All of the following are aspects of the search process except
    8·1 answer
  • Most software packages have functions for generating _____ about columns of data, which include statistical summaries like contr
    7·1 answer
  • Drag each label to the correct location on the image.
    7·1 answer
  • Which of the following is the best way to remember the points you want to make during the presentation of your slide show?
    5·1 answer
  • To create a cell reference in another spreadsheet you must need to start with _______ sign.
    14·1 answer
  • What is a wiki website?
    11·1 answer
  • Input images into a computer
    11·1 answer
  • Which element of the MakeCode Arcade interface represents an individual
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!