The CNC machine works based on CAD and CAM programs and computer control. CAD is drawing software. CAM has two codes, e.g. B. G-Code and M-Code on which all programs are written and fed into the machine to perform various operations.