C Program: A Simple Use of gotoxy() to Display Hindi Text

0
698

C Program: A Simple Use of gotoxy() to Display Hindi Text

Gotoxy () function is used in programs to make the cursor move to different positions as it is on a graph, as it divides the output screen into a graph with x and y coordinates and as the user gives both x and y coordinates in the function gotoxy() the pointer move to that location and print accordingly.

We begin our code by including the header files “stdio.h”, “conio.h” and “dos.h”

C Program: A Simple Use of gotoxy() to Display Hindi Text

After including the header files a simple message will be displayed on the output screen saying “look at this” which makes the user to concentrate on the text coming up next and this quote vanishes after 2 secs as “delay” function is used

C Program: A Simple Use of gotoxy() to Display Hindi Text

As C language, does not support Hindi text directly so to display Hindi text on the output screen we need to use gotoxy () statements and display it using a “*”.

We will break down the text we need to display in as many portions as we can on the graph so it gets simple, so we know which loop we have to execute as many times. After breaking the text which needs to be displayed we’ll also record the coordinates which we will provide in the gotoxy () statements through which our output screen cursor will move to different positions and display the text or a line or a part of the  text.

after completing a single for loop the code continues to another for loop to further continue to display the rest of the text on the new location where gotoxy () statement take it to.

C Program: A Simple Use of gotoxy() to Display Hindi Text

After the Hindi text has been displayed, the function getch () holds the output screen for the user to read the text for some time and as the user presses any key it comes out of the output screen or window and the code ends.

The code is easy to understand the logic, if you know in how many parts you will break the text you need to display and the coordinates where you will move the cursor so to display every part of the text correctly.

C Program: A Simple Use of gotoxy() to Display Hindi Text

Download C Program: A Simple Use of gotoxy() to Display Hindi Text

LEAVE A REPLY

Please enter your comment!
Please enter your name here