Duplicate values removal from array
Duplicate values removal from array:
//removal duplicate values from array
#include<iostream>
using namespace std;
void main()
{
int a[8]={1,2,3,3,4,1,2,1};
int b[8]={0,0,0,0,0,0,0,0};
b[0]=a[0];
for(int i=1;i<8;i++)
{
int counter=0;
for(int j=0;j<i;j++)
{
if(a[i]==b[j])
counter++;
}
if(counter>0)
b[i]=0;
else
b[i]=a[i];
}
for(int k=0;k<8;k++)
{
if(b[k]!=0)
cout<<b[k]<<" ";
}
cout<<endl;
}
Download:
To download this code click on the given link below:
Arithmetic operations in Assembly Language are a testament to the power of low-level programming. With precise control over registers and instructions, these operations unlock the potential for blazing-fast calculations .
ReplyDelete