If I draw a line 10 inches on illustrator and then take a print then the printed line is either 8 inches or 12 inches.it is not printing the exact size....
Are you sure you are printing at 100% size?
If you do print at 100% as auggested by Monika and it (still) fails, are you using a PostScript (emulating) printer driver, and if not, what happens if you switch to that or print to/save as PDF and print from Acrobat?
When you write either 8 inches or 12 inches, does that mean that it can vary with different prints of the same line made in the same way?
I believe it will help helpers if you can post screenshots of what you are using/changing, please use the Insert Photos button at the top of the Reply box so we can see them straight away (attatching hides them).
You can also refer to this,