//check location of return statement //Add return statement after void case '2': void displayInfo(); return displayInfo(); break; //Not after switch closes, as then it will return nevertheless