Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Please read the problems I am having. They are listed below the code. ----------

ID: 3643230 • Letter: P

Question

Please read the problems I am having. They are listed below the code.

------------------------------------------------------------------------------------

#include<iostream>

using namespace std;

void eliminate(int a[], int &siz)
{
int i,k=0;
bool b[101]={false};
for(i=0;i<siz;i++)
if(b[a[i]]==false){
a[k++] = a[i];
b[a[i]]=true;
}
siz = k-1;
}



int main()
{
int nums[11];
int i,n=11;
cout<<"Please enter 10 integers, hitting return after each one: ";

for(i=0;i<n;i++)
cin>>nums[i];

eliminate(nums,n);
//cout<<endl;
for(i=0;i<n;i++)
cout<<nums[i]<<" ";

return 0;
}

-------------------------------------------------------------------------------------

Problems:

For the second output I do not receive anything. I should receive 100.

For the last output I only receive 12.

Explanation / Answer

there is a programming error in the first part in the second part the iteration is not carrying on pls rate if helpful

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote