You are on page 1of 3

Repetition of element in an array

#include<stdio.h
#include<stdlib.h
void printRepeating(int arr,, int size)
,
int i, j;
printf(" Repeating elements are ");
for(i = 0; i < size; i++)
for(j = i+1; j < size; j++)
if(arri, == arrj,)
printf(" %d ", arri,);
,

int main()
,
int arr, = ,4, 2, 4, 5, 2, 3, 1,;
int arr_size = sizeof(arr)/sizeof(arr0,);
printRepeating(arr, arr_size);
getchar();
return 0;
,
9f

include stdio.h~
#deIine DIM 10

int main(int, int||)
int x|DIM|;
int Cntr 0;

Ior (Cntr 0; Cntr 10; Cntr)
printI("d ~ ", Cntr);
scanI("d ", x|Cntr|);
}

void partition(x, DIM)
int count 0;
int c, result;
int z|10|;

partition(x, DIM);
Ior (Cntr 0; Cntr 10; Cntr)
printI("d ", x|Cntr|);
}


Ior (c 0; c DIM; c)
result a|c|2;
iI (result 0)
a|c| z|count|;
count;
}
}
Ior (c 0; c DIM; c)
result a|c|2;
iI (result ! 0)
a|c| z|count|;
count;
}
}
Ior (c 0; c DIM, c)
a|c| z|c|;
printI("d ", a|c|);
}


kth element
#include <stdio.h
#include<conio.h
main()
,
int a20,, i,n;
printf("ent how many elements u want to enter");
scanf("%d",&n);
printf("enter the elements");
for(i=1;i<=n;i++)
scanf("%d",&ai,));
s=a1,;
for(i=2;i<=n;i++)
,
if
,
sai,
s=ai,
,
,
printf("the smallest element is %d",s);
,

You might also like