Counting Visitor using internal EEPROM

void print(int num)
{
for(i=0;num!=0;i++)
	{
	digits[i]=num%10;
	digit[i]=seven_segment(digits[i]);
	num=num/10;
	}
	/* main part display number*/
	for(i=0;i<3;i++)
	{	
		PORTD=0x07;     // Dark condition
		_delay_ms(5);
		PORTB=digit[i];
		PORTD&=~(1<<i); // i display on
		_delay_ms(5);
		PORTD=0x07;     // Dark condition    
		_delay_ms(5);
		
	}
}
#include<avr/io.h>
#include<util/delay.h>
#include<avr/eeprom.h>
#include"count.h"
uint8_t x,start;
uint16_t num=0,value,z;
int main(void)
{
DDRB=0xff;										//7 segment port
PORTB=0b11111100;								//default value 0 to all the 7 segment;
DDRD=0x07;										//7 segment control port
PORTD|=(1<<PIND4);								//push button to clear the eeprom
z=eeprom_read_word((uint16_t*) 100);
num=z;
	while(1)
	{
	start=PIND&0b00010000;
	if(start==0)
	{	
		eeprom_update_word((uint16_t*) 100,0); //clear EEPROM
		num=0;                                 //clear cash 
		display_zero();
		while(!(PIND&0b00001000));
		_delay_ms(100);                         //wait for switch debouncing delay
	}
	x=PIND&0b00001000;
	if(x==8)
	{
	num++;
	print(num);
	_delay_ms(150);
		eeprom_update_word((uint16_t*) 100,num);
	}
	else print(num);
	}
return 0;
}