I am using keil uv5 but hex file created is only of 4kb even though i have written enough program and i am using lpc2138 and it happens for every program I write so I am unable to load my program in my microcontroller
1) That's a tiny program, so why expect a large hex file?
2) Your source file is uart.c. But the source code doesn't seem to relate to any UART.
3) Are you sure you have any LED on the specific pins?
4) How have you verified that the program gets downloaded correctly?
5) How have you verified what happens on the relevant port pins?
6) How do you know if the processor leaves the reset state?
7) How do you know the processor doesn't stays in the boot loader?
8) Have you verified all project settings?
9) Any other observations you have made, that is actually relevant to your problem and not related to your assumptions about size of produced hex file?