Write a C program that request five integer values from the
Write a C++ program that request five integer values from the user. It then prints
one of two things: if any of the values entered are duplicates, it prints \"DUPLICATES\";
otherwhise, it prints \"ALL UNIQUE\".
Solution
#include<iostream>
using namespace std;
int main()
{
int a[5];
cout<<\"\ enter five integers:\";
for(int i=0;i<5;i++)
{
cout<<\"element\"<<i+1<<\":\";
cin>>a[i];
}
for(int i=0;i<5;i++)
{
for(int j=i;j<5;j++)
{
if(a[i]==a[j])
{
cout<<\"\ DUPLICATES\";
goto abc;
}
}
}
cout<<\"\ ALL UNIQUE\";
abc:
return 0;
}
