#include <stdio.h>
#include <stdlib.h>
int main() {
int arr[5]= {1,4,3,5,6,};
int i,j;
int un=0;
for(int i=0;i<5;i++)
{
printf("%d ",i);
for(j=i+1;j<5;j++)
{
if(arr[i]==arr[j])
{
un=1;
break;
}
}
//if(un==1)
//break;
}
if(un==1)
{
printf("the value is not unique:");
}
else
{
printf("the value is unique");
}
return 0;
}
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter