Code for Multiplexer and Demultiplexer ( mux and demux)