#include <stdio.

h>
#include <stdlib.h>
struct node
{
int data;
int key;
};
/* run this program using the console pauser or add your own getch, system("pause")
or input loop */
int hashkey(int size,int input)
{
return input%size;
}
void insert(int key,int size,int arr[size],int input)
{
while(15)
{
if(arr[key]==-1)
{
arr[key]=input;
break;

}
if(key<size)
key++;
else
key=0;

}

}
int main(int argc, char *argv[]) {

int input_size;
printf("give the size of your elements\n");
scanf("%d",&input_size);
int arr[input_size];
int i;
for(i=0;i<input_size;i++)
{
arr[i]=-1;
}

printf("input the elements\n");

for(i=0;i<input_size;i++)
{

int input;
scanf("%d",&input);
int key=hashkey(input_size,input);
insert(key,input_size,arr,input);

}
//printing the elements in hash table
for(i=0; i<input_size; i++)
{
printf("%d\n",arr[i]);

} return 0. } .