An ear is the collection of seeds that are grouped together at the top of the seed stalk. This is common to all grasses. Cereals are just grasses that have been bred so that the seeds are bigger and so give us more food to eat.
When the ears of corn are harvested (for example using a combine harvester), the seeds separate and can be ground for flour separately.
Corn is a word used in much of the world to mean any cereal seed. However, in North America, the word is used to mean maize. Maize in the rest of the world is called sweet corn.