declare two dynamic arrays of integers, input size needed for the arras, allocate size integers, initialize all elements to 0, prompt the user to input size elements in the first array, diplay the elements, copy the elements to the second array after deleting duplicate elements, and display the elements from second array.

Recommended Answers

All 6 Replies

#include<iostream.h>
#include<conio.h>
void main()
{
    clrscr();
    int size;
    int*p;
    cout<<"\n please enter the size of your array:";
    cin>>size;
    p=newint[size];
    cout<<"\n type"<<size<<"elements:";
    for(int i=0; i<size; i++)
    {
        cin>>p[i];
    }

i dont know the last part for copying without duplication

#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int size;
int*p;
cout<<"\n enter the size of your array:";
cin>>size;
p=new int[size];
cout<<"\n type"<<size<<"elements:";
for(int i=0; i<size; i++)
{
cin>>p[i];
}
getch();
}

now my indentation error is ok?

i don't know the duplicate part can u Please tell the code

Please if u know then please help me through these questions. You can do them in some minutes while i will take much more time. I have many other homeworks. If u can help me i will be very thankful to you.

Sorry dude, but I think a good lesson for you right now would be to fail miserably because you relied too much on the kindness of others in doing your work for you.

oks thank you

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.