The guardian must also hit them for not performing the prayer after they are ten lunar years old.
The same is done in the case of fasting-if the children can bear fasting.It is an obligation on the guardian of the child who has reached the age of seven (7) lunar years, (usually the age of mental discrimination), to order him to pray and fast, if he can bear fasting.
However, if the child becomes ten (10) years old and does not pray or fast although he is able, his guardian must hit him for leaving out this matter in order to teach him the seriousness of his negligence and to urge him to perform these important matters.
This is in accordance with the Hadeeth of the Prophet, related by Abu Daawud:
It means: <<Order your children with prayer when they reach seven (7) lunar years of age, and hit them for leaving it out when they reach ten (10); and separate them in their sleeping places. >>
To separate them in their sleeping places means to let each one sleep under a separate cover such that they are not touching skin to skin.
It is prohibited to let them sleep while their unlawful nakedness (^awrah) is uncovered under one covering such a way that they can touch these parts skin to skin.
In this case, it is an obligation to separate them.
If their unlawful nakedness (^awrah) is covered while they sleep, having separate covers is Sunnah.
In the case when hitting the child for leaving out prayers or fasting is an obligation, it is a condition that the hitting is commensurate with the offense, i.e., it must be harsh enough to show the child the enormity of one neglecting prayers and fasting.
However, it must not be so severe as to break his bones, poke out his eye, or otherwise harm him severely.