Line program in c
Close Privacy Overview This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website.
These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience. Necessary Necessary. Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. And also : What did you expect? What did you do? What did you have?
How is that different from what you expected? What have you tried to understand your problem? Show 2 more comments. Active Oldest Votes. The logic of this program is as follows: Save current character as the previous character.
Get the next character and make it the current character. Check the current character to see if it's a newline character. If it is, then we increment the line counter and restart the loop. Check the current character to see if it's EOF and the previous character to see if it's the newline character.
If it is, then break out of the loop. Check the current character to see if it's EOF. If it is, then increment the line counter and break out of the loop. Because sometimes to get the desired output we may require to draw different types of lines.
Here we will learn to draw horizontal lines, vertical lines, and slant lines along with various styles. Now, the program to demonstrate the above three line functions is given below through which you can understand easily.
So the code above illustrates the use of line , linerel , and lineto graphics library functions. In the code above, the setlinestyle 0,0,3 function sets a solid line with a thick width. This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More. Close Privacy Overview This website uses cookies to improve your experience while you navigate through the website.
Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies.
But opting out of some of these cookies may affect your browsing experience.
0コメント