Computer is an electronic device that can be instructed to carry out sequences of arithmetic or logical operations automatically via computer programs. The main components of a computer are the input, output, processing, and storage units. The central processing unit (CPU) controls all other components and processes data through its arithmetic logic unit and control unit. Primary memory, such as RAM and ROM, allows for temporary and permanent data storage respectively. Secondary memory like hard disks, optical disks, and flash drives provide larger storage capacities.