Official Aviation Definition
A squawk code is a discrete four-digit octal number (each digit from 0 to 7) entered into an aircraft transponder. Assigned by ATC or designated by standard emergency protocols (such as 7500 for hijack, 7600 for radio failure, 7700 for emergency), it allows secondary surveillance radar to identify specific aircraft.
In Simple Words
A 4-digit code given to a pilot to type into the transponder radio so radar screens can track that exact flight.
Real-World Flight Example
Air Traffic Control instructed the departing flight: "AIF 104, squawk 4215 and ident."