If an aircraft stalls, there are stall warning systems called as Stall computers. Anyone has idea how they predict that its a stall and how they raise the alarm/warning?
On light aircraft there is a reed (much like used on a musical wind instrument) mounted on one wing root, which is angled such that at the Angle of Attack which would cause a stall, the reed "plays" which can be heard in the cockpit.
Here is a view of where this system is mounted on a Cessna:
On some aircraft, it is a similar principle; however instead of a reed, it uses a fin which at critical AoA pushes a micro-switch which activates a buzzer/horn inside the cockpit.
Here is the assembly on a Beech 18:
So, if you ever see anyone doing this:
They are not kissing their aircraft for good luck, merely testing the stall warn as part of pre-flight checks!
In addition to an audible reed/buzz/horn, most aircraft also provide tactile feedback to the pilot of an impending stall. In purely mechanical aircraft the aerodynamic forces on the control surfaces are transmitted through the mechanisms and are felt directly by the pilot when approaching a stall. In hydraulic or fly-by-wire aircraft, this is provided by a mechanical "stick shaker" linked to the same system as sounding the audible alarm.
When the computer(s) calculate an AoA nearing the critical angle, an impending stall is communicated to the pilots. There are visual indications, such as those given on the speed tape and pitch limit indicators (PLI), and tactile indications such as the stick shaker and pusher. Here is a Boeing Article on AoA measurement (PDF). Figure 11 shows the indications on the primary flight display.