
130 S.E.2d 408 (1963)
259 N.C. 280
FREMONT CITY BOARD OF EDUCATION
v.
WAYNE COUNTY BOARD OF EDUCATION.
No. 306.
Supreme Court of North Carolina.
April 17, 1963.
*409 James N. Smith, Goldsboro, and Lake, Boyce & Lake, by I. Beverly Lake, Raleigh, for plaintiff-appellant.
Bland & Freeman, by W. Parnell Bland and George K. Freeman, Jr., Goldsboro, for defendant-appellee.
Atty. Gen. T. W. Bruton and Asst. Atty. Gen. Ralph Moody, Raleigh, amicus curiae.
RODMAN, Justice.
The Legislature, for the efficient operation of the public school system required by Article IX of our Constitution, has divided the State into administrative areas. G.S. § 115-4. School attendance is mandatory between the ages of seven and sixteen, G.S. § 115-166, and permissive beyond that age, G.S. § 115-1. Education provided by the State is free. Teachers paid with State funds are allocated to administrative units on the basis of average daily attendance. G.S. § 115-59. Normally children attend a school in the area in which they reside. Each administrative unit must keep a continuous census of the school population in its area. G.S. § 115-161. The several boards of education are required "to provide for the assignment to a public school of each child residing within the administrative unit." G.S. § 115-176. A child may, however, be assigned to a school outside his administrative area by agreement of the school boards affected by the change in assignment. The agreement must be reduced to writing and entered on the official records of the respective boards. Except by agreement "(n)o child shall be enrolled in or permitted to attend any public school other than the public school to which the child has been assigned by the appropriate board of education." G.S. § 115-176.
The complaint alleges and the demurrer admits: The parties are corporate entities charged with the operation of public schools in their respective units. Plaintiff assigned for the 1962-63 school year five named children who resided within Fremont Administrative Unit to Fremont High School; notwithstanding such residence and assignment, defendant enrolled said children in and permitted them to attend a school under defendant's supervision. Plaintiff has alleged a violation of statutory law designed and intended to provide for the efficient and economic operation of our public school system, a violation which could easily lead to impairment in the operation of the schools in plaintiff's area.
We read the language used to dismiss the action as holding that plaintiff had stated a cause of action. That holding was correct.
The grounds for demurrer are stated in G.S. § 1-127. The fact that a plaintiff seeks relief not warranted by his allegations is not within that enumeration. A prayer for relief is not a necessary part of the complaint. Lockman v. Lockman, 220 N.C. 95, 16 S.E.2d 670. Relief will be granted as warranted by the allegations and proof. McCampbell v. Valdese Building & Loan Ass'n., 231 N.C. 647, 58 S.E.2d 617; Dry v. Board of Drainage Commissioners, 218 N.C. 356, 11 S.E.2d 143.
Whether defendant should be required by the legal writ of mandamus to terminate the enrollment of the named children in the schools administered by it or prohibited by the equitable writ of injunction from continuing to admit to its schools residents of another school administrative *410 area need not now be decided. The same result can be accomplished by either writ. See New Bern v. Atlantic & N. C. R. R. Co., 159 N.C. 542, 75 S.E. 807; Durham v. Southern R. R. Co., 185 N.C. 240, 117 S.E. 17, 35 A.L.R. 1313. The Superior Court has authority to issue either writ. An injured party is not now compelled to ponder whether he should apply to a court of law or a court of equity for relief.
If defendant should by answer challenge the allegation with respect to the residence of the children, the court may, upon a proper showing, grant injunctive relief until the vital question of residence has been determined. It should not issue a writ of mandamus until the controverted factual issues have been determined as provided in actions at law. Harris v. Board of Education, 216 N.C. 147, 4 S.E.2d 328.
Reversed.
