PWM

What is the programming for pwm for fan..?

Assuming it is a simple DC motor then the programming is the same as for any other simple DC motor.

Does I need that DC motor for the fan?

FaiZamri:
Does I need that DC motor for the fan?

You can use an AC motor, but the hardware interface will be different. AC fans need a zero crossing detector and something like a triac/SCR.

A DC motor is easier as you can just use an ordinary transistor.