If the teacher asks for source code, just send source code. You don't worry about the executable and so on. Obviously, make sure the code compiles properly, because if the teacher can't compile it, you fail.
Ok, there's two ways you can distribute a program. You can either distribute the source, forcing people to compile it themselves. Or you can distribute the binary, the result after compiling the source.
There's three types of programming languages (this is one way to classify them). Native compilation, JIT compile/bytecode interpreter, and a source interpreter.
So, with a native compilation, you get an executable that depends on the computer itself (or more precisely the processor), the OS, (Windows binaries are different from Linux binaries), and any runtime libraries that your program needs (example is CRT runtime when dynamically linked). When distributing binaries, you need to make sure all three are satisfied. That's why when downloading files, you see information like, Windows, i386. Or Linux, K-8, requires so and so packages on the system, etc. Standard C and Standard C++ give you a native executable.
With JIT compilation or a bytecode interpreter, your executable isn't native. The processor does not understand the instructions in it, because it really is an intermediate file. Instead, you need whatever interpreter or runtime environment is necessary to work with that intermediate file. The intermediate file may or may not be OS specific, depending on how the language works. For .NET languages like C++ .NET, C# .NET, VB .NET, etc., your programs require the .NET runtime to be run. Without it, they won't work. Yes, you will need to tell people that it requires .NET. If they don't have it, they can't use it. Same with Java. People need the Java runtime environment to run java programs.
Source interpeted is like bytecode interpreted or JIT compiled in that you need an interpreter. Ruby and Python are good examples (Python can be distributed in bytecode form though).
Hope my explanation clarifies.