What is program counter

A program counter, also known as an instruction pointer, is a register in a computer processor that keeps track of the memory address of the next instruction to be executed. The program counter is automatically incremented after each instruction is fetched and is a crucial component in the control flow of a program. It plays a key role in the execution of machine code and the sequential processing of instructions in a computer program.