Answer : Ionic compound is created when potassium and chlorine combine. The chemical formula of the compound is KCl.
Explanation :
When potassium and chlorine combine then the type of compound created is Ionic compound.
Ionic compound : These are those compounds which are made of a metal element and non-metal element. Salts are ionic compound which consists of a positive and negative ions.
The electronic configuration of Potassium is,

The electronic configuration of Chlorine is,

From this we conclude that the potassium atom is a metal which has 1 electron in their valence shell and chlorine atom is a non-metal which has 7 electrons in their valence shell. For the complete octet, chlorine atom needs only 1 electron which it receives from the potassium atom.
During this process, potassium atom will loses 1 electron and acquire positive charge and chlorine atom will gain 1 electron from potassium atom and acquire negative charge.

The chemical formula of the compound is KCl.