Duplicate element removing of Arry C++ program




 Duplicate  Element Removing Program


 #include<iostream.h>

int main()
{
cout<<"             Program for Removing dublicate num for Arry "<<endl<<endl;   
int size,num,duplicate,m=0,a,b;   
cout<<"How many number u want to enter ==== ";
cin>>size;   
int arry[size];
cout<<"Your Arry is ==="<<endl;
for(a=0;a<size;a++)
{
duplicate=0;   
cin>>num;   
 for(b=0;b<m;b++)
  {
  if(num==arry[b])
     {
    duplicate=1;
    break;    
     }    
  }
 if(!duplicate)        
   {
  arry[m++]=num;
     
   }
}
cout<<"YOur Arry After Removing duplicate"<<endl;   
for(b=0;b<m;b++)
{
cout<<arry[b]<<" ";   
}   
cout<<endl;    

}

                           <<<<<<<                                         >>>>>>>                           


Share on Google Plus

About Unknown

This is a short description in the author block about the author. You edit it by entering text in the "Biographical Info" field in the user admin panel.
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment

Powered by Blogger.

Translate

 
 
.