Prepare Interview

Mock Exams

Make Homepage

Bookmark this page

Subscribe Email Address

Language%20in%20C%20Interview%20Questions%20and%20Answers

Question: Can we get the x and y coordinate of the current cursor position ?

Answer: The function wherex( ) and wherey( ) returns the x-coordinate and y-coordinate of the current cursor position respectively. Both the functions return an integer value. The value returned by wherex( ) is the horizontal position of cursor and the value returned by wherey( ) is the vertical position of the cursor. Following program shows how to use the wherex( ) and wherey( ) functions.

#include <conio.h>
main( )
{
printf ( "Justn Ton Testn Wheren the cursorn goes" ) ;

printf ( "Current location is X: %d Y: %dn", wherex( ), wherey( ) ) ;
}
Is it helpful? Yes No

Most helpful rated by users:

©2024 WithoutBook