I am new in Microcontroller.
I want to Convert DC 12V to 5V and 5V to 3.3V.
I come to know that LM1117 is suitable for it.
But i want the cheapest Voltage Regulator for this Purpose.
Using a $0.10 TL431 in linear regulator configuration costs a little more than the zener-transistor combo, but provides better regulation (which can be important for accurate ADC readings from a microcontroller):
Output voltage can be altered by changing resistor values. Max output current can be altered by choosing an appropriate transistor and optional heatsink, and you can often salvage them for free from old circuit boards.
The TL431 has many other uses as well, check the datasheet for some ideas. As inexpensive and versatile as they are, it's good to always have a few on hand; as you can always make a linear regulator or other things without stocking more expensive and specialized parts.
BTW, there's no efficiency advantage in getting your 3.3V via linear regulator from the 5V supply, if the 5V supply itself comes via linear regulator from 12V. Instead, convert directly from 12V to 3.3V; then you don't have to worry about using a low-dropout regulator like the LM1117.
I assume you can use an LM317 if you don't need the 5v, you can use a 270 ohm (ADJ - OUT) and 6k8 parallel with 470R (GND - ADJ) for 3v3 output,
it can also be done with other resistor combinations.
The bonus you get is overheat and short circuit protection, if you use a simple transistor
and you do a mistake you may burn the device you are powering which will be more expensive.