C Language
GotoxySyntax:
gotoxy(int x, int y); Those who are tired of the usual display of your program in C can modify its positioning using the gotoxy(x,y); function, wherein x and y are whole numbers that represent the coordinates on the screen: maximum x=80 and y=24. This will bring more attractive output to your program especially if you have lots of designs to include or just if you want all the information to be organized. You can put gotoxy(x,y); function at the beginning of printf or scanf functions. Example: #include<stdio.h> int main() { gotoxy(5,15); /*sets the x and y position */ printf("This text location is 5 characters from the left and 15 characters from the top"); getch(); } Textcolor, Textattr, Textbackground
Syntax: textattr(int); textcolor(int); textbackground(int); int colors 0 BLACK 1 BLUE 2 GREEN 3 CYAN 4 RED 5 MAGENTA 6 BROWN 7 LIGHTGRAY 8 DARKGRAY 9 LIGHTBLUE 10 LIGHTGREEN 11 LIGHTCYAN 12 LIGHTRED 13 LIGHTMAGENTA 14 YELLOW 15 WHITE Putting colors on text and background on your program will make it more lively. This is another way to improve your program from it's static display to dynamic desgin. |
|
Quick Links |