When I run it the program will repeatively rewrite everything when I type 'y'.
Really? Weird. It doesn't do anything of the sort when I run it. Mind you, what it doesn't do is clear the screen, since I removed all the <conio.h>
-related function calls (the compiler I was using doesn't have any equivalent to that), which may be what you are actually noticing.
Loking at your code, you still haven't written the octal and hex conversions correctly; instead, what you are reading the value into a variable as a long
value, then after some ineffective 'conversion', you are printing that same variable out as a decimal, without changing anything. You are not actually converting anything in your code; the scanf()
and printf()
functions are doing the conversions. This does not actually fulfill the requirements of the project, at least not as I understand it.
As for the default
case, it is not necessary to have one, but it is best to handle all possible cases, so I would have kept it in.
BTW, you are still using void main()
. Please, please, please fix that.