To what extent can a computer be reset to factory settings?
Our teacher gave us 2 used computers and asked us to format them and we did. Then we installed Windows 10 on both. Now he comes and says "I don't want any OS on them". Of course, when a computer is just manufactured, it has no OS. He wants us to revert the computer to that state, to disassemble and reassemble its parts, and install any OS on it. But it seems to me that the first thing any OS is programmed to do is not allow the user to delete it when there are no installed operating systems on the computer. It seems the needed result can't be achieved. Or is it? I don't know. Since we will disassemble it anyway, I might learn how to reset everything using the hardware. So can you do that in any way (even using hardware; maybe unplug or change some cables)?
EDIT
Regardless of the context is, I have Win 10 on 2 computers each, and I want to remove it and revert the computer to the "dead box" state
It is possible to boot a computer without installing the OS on the hard disk. This is what happens with DBAN. The DVD or USB contains an image file of an operating system which is loaded into memory, making the computer function. On DBAN, a program is loaded which writes to a hard disk, removing and obliterating all the data it contains. When the computer is switched off, the OS disappears from memory, leaving the disks blank.
Some information is held in nonvolatile memory on the system board in the form of BIOS settings. These are often maintained by a battery which can be removed.
If you want to "reset" a computer as near "pre-assembly specs" as possible, you need to wipe the drives, reset the BIOS and disassemble the individual parts.
Wiping the drives, so that they are completely empty or filled with random bits can be achieved with a bootable (USB/CD-ROM) system like DBAN: https://dban.org/ (instructions to create media, etc can be found under Help / Installation Questions).
If your computer(s) are already disassembled, you need to connect the drives to another computer (via USB or internally via SATA) and do the wiping there.
Some BIOSes offer a disk wipe option (mostly laptops, though), so it might be worth checking that out too.
BIOS (or UEFI, whichever you have in the computer) settings can be reset in the BIOS itself.
The entirety of the OS depends on the first few sectors of the hard drive. Without this critical first sector, the entire hard drive may as well be filled with random bits. You can grab a Live Linux OS disc, pop it in to your computer, and run a command like the following (run as root):
dd if=/dev/zero of=/dev/sda bs=4096 count=4096
At this point, the GPT or UEFI structures at the beginning of the drive will be zeroed out, and the computer will not be able boot at all, as if the hard drive were brand new (though there will be bits and pieces of the OS scattered throughout the rest of the drive).
It's important to note that the OS is not installed on the computer, it's installed on the hard drive. You can move the hard drive from one computer to another and the OS may run on the new hardware. Note that using the command above will render the drive unusable in any computer until it is formatted.
NOTE: Make sure you check the location of the hard drive before using the command. Not all Linux systems will map the hard drive to /dev/sda. You can use the lsblk command to verify the device that the hard drive is mapped to. (Thanks to @HSchmale for the comment).
There are a few things which are unclear from your post - specifically if a computer is to be returned to its "factory" state, depending on the PC it will either have an OS on a disk image on the hard drive, or the hard drive will be TOTALLY blank - ie not formatted.
A computer does nothing to prevent a user from deleting the OS, however if there is no OS on it there are usually no built in tools to do anything. In this case you would typically boot of a DVD or USB disk and install an OS.
Windows and Linux installers both offer the opportunity to boot a USB installer and overwrite the old OS/system. If this is what you want to do, download a copy of Ubuntu (or another distro if you prefer), install it on a USB key, boot from it and reinstall the OS.
If you want to totally erase the hard drive, prepare a USB stick with Ubuntu, boot Ubuntu, click on the swirly round thing at the top, type terminal and launch the terminal. This should provide a black box. Type sudo /bin/bash to get full admin access. Use fdisk -l
to find the appropriate disk (which will be called /dev/sd?) - you can tell the appropriate one by it size. Then type dd if=/dev/zero of=/dev/sd? bs=512 count=1
and reboot. This command will erase the first 512 bytes of the disk and make it appear to the OS as is new and unformatted. (If you change the bs to something like 65536 and leave off the count option it will zero out the entire disk - this will take a LONG time)