I am new to ubuntu and running ubuntu 15.10. I was trying to run a C code and got the following error.
so I installed it with the given command and now it says:
how to do i run it? New to this so bear with me.
EDIT: the output for echo $PATHis below:
When i run the command dpkg --listfiles gcc | grep bin/gcc i get the following output 

It looks like something is wrong with your machine. There are a few things to check if things go wrong.
1. Check the
PATHvariableFirst you need to check that the PATH variable contains the system managed installation directories, such as
/usr/bin.Type
echo $PATHon the console and make sure that it contains a sequence of paths delimited by:that contains/usr/bin, as well as/bin2. Check if the package files are present
Type
dpkg --verify gcc ; echo $?. If the package files are present, this command should print out0.Type
dpkg --listfiles gccto get a list of files that were installed whengccwas installed. Check if/usr/bin/gccis on the list. You could usegrepto filter output.3. Check if there are any conflicts or missing dependencies
Use
dpkg --statuscommand.Here the command says that the documentation is outdated or missing for the compiler.
4. Check that the file
/usr/bin/gcchas correct permissionsIt should be executable
In Ubuntu
/usr/bin/gccis a symbolic link to the correct version of the compiler. Check that the link is valid.5. Check that the package that contains compiler binary is installed
See what package provides the compiler binary:
Repeat steps 2-4 for the package
gcc-4.9.6. Try to run it
Try running the executable with the full path:
If any of the above steps fail, this could provide a further hint on the cause of the problem.