Text in C++ graphics by R4R Team

- outtextxy() is the function which are able to display the text on the screen.

Syntax-
outtextxy(x,y,"Text");

program-

#include< stdio.h>
#include< conio.h>
#include< graphics.h>
void main()
{
int gd=DETECT,gm=0,i,x=100,y=0;
initgraph(&gd,&gm,"");
for(i=0;i< 10;i++){
setcolor(i);
y=y+30;
outtextxy(200,y,"My Text in C %d");
}
getch();
}


output:




Leave a Comment: