generally we can build a application in java and vb make it as a exe.but how do we build application using c or c++.even some operating systems like xp was written in c++.how is it possible????/

It depends on the operating system you want to use. On MS-Windows you need a c and/or c++ compiler, such as free Code::Blocks with MinGW compiler or VC++ 2010 Express. On *nix you can use free gcc or g++ compilers.

You can create/compile programs for other operating systems by using a compiler called "cross compiler".