You are on page 1of 1

#include<stdio.

h>
#include"scan.h"
#include"swap.h"
#include"quicksort.h"
#include"print.h"
int odd_times(int ar[], int ar_size)
{
int res = 0;
for (int i = 0; i < ar_size; i++)
res = res ^ ar[i];

return res;
}

void main()
{
int n;
int *array;
printf("Enter the no. of elements");
scanf("%d",&n);
array=calloc(n,sizeof(int));
scan(array,n);
int res=odd_times(array,n);
printf("odd no of times. : %d",array[res]);
}

You might also like