Ask your own question, for FREE!
Computer Science 8 Online
OpenStudy (anonymous):

how can i draw a line y=mx+c using C language without using graphics header file..

OpenStudy (anonymous):

@asnaseer help me

OpenStudy (asnaseer):

sorry - graphics is not really my area.

OpenStudy (anonymous):

ok..

OpenStudy (anonymous):

thats why he said without graphics :D

OpenStudy (anonymous):

the way we did it before graphics (yes, I am that old) solve for Y=5 and print a '*' there and at X=0 repeat down to 1 draw a line of '*'s then do Y=-1 on down to -5 so you end up with something like this: * * * * * * ** *************************** ** * * * * * * * * well, you get the idea... hope it helps

OpenStudy (anonymous):

@philips 13 i want to draw a line ,not stars(*)

OpenStudy (anonymous):

The C programming language does not have any built-in capabilities for drawing lines (or anything, for that matter). You need to use some kind of graphics library, such as OpenGL (among many many others). SInce you implicitly ruled out "using graphics header" (which I, as well as philips13, interpreted to mean that you're not allowed to use a graphics library---which are typically linked to your program via some sort of header), printing characters is pretty much the only option you have, so philips13 is right. Or perhaps we both misunderstood your requirements; perhaps you can clarify them? If you are not allowing any libraries, in principle the only way to draw proper lines is by "talking" directly to the hardware. If you have a half-way modern operating system (i. e. you are not using an embedded device or a computer from the 80s or before) that is also out of the question.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!