A gun is a mechanical device that fires projectiles at high velocity, using a propellant such as gun powder or compressed air.
The term gun is often used as a synonym to firearm, but in its more technical usage refers only to artillery that fires projectiles at a high velocity along a flat trajectory, such as field guns, tank guns and anti-tank guns, and naval guns. Howitzers, mortars, and all hand-held firearms are excluded from this definition. The exception to this is the shotgun, which is hand-held, has a smooth bore and fires a cartridge of pellets.
The word gun is also applied to some more or less vaguely gun-like tools, glue gun for example.