Homework Help

QBinary search c++ lottery program 2

Change this code to a binary search,last time you gave me the same code on binary search c++ lottery program and I'm wasting pts cause the last code was mess up . Ineed a full code that can run, not a partial code a full code.

using namespace std;

const int size=10;
int linearsearch(int array[], int size, int value)
for(int i=0; iif(array[i] == value) return 1;

int main()
int *numbers;
int N;
int count;
int results;
cout<<"How many lottery tickets were purchased?:";
cin>> N;
numbers= new int[N];
cout<<"\nEnter winning lottery ticket's numbers...\n";
for (count=0; count{
cout<<"Winning Number Lottery ticket #"<<(count+1)<<": ";

for (count=0; count{
cout<<"\nEnter your lottery number:";

if (results == 0)
cout<<"Quitting Program\n";

int k=linearsearch(numbers,N,results);
if (k == 1)

return 0;


This question still have no answer summary yet.

This Question: "Binary search c++ lottery program 2" No answers yet.

Be the First! Or read related questions

Anonymous Sign In Sign Up
Add Answer of
Binary search c++ lottery program 2

Did this answer your question? If not, ask a new question.

Related Answers