Reputation: 33
The following code doesn't have any error but it won't run. There's just a flash on the screen when I run it. It doesn't provide any output. what do I have to do?
#include<graphics.h>
#include<conio.h>
void main()
{
int gd = DETECT, gm;
initgraph (&gd, &gm, "");
setbkcolor (15);
setcolor (0);
settextjustify (1,1);
settextstyle (3,0,12);
outtextxy (getmaxx()/2, 1, "BATAAN PENINSULA STATE UNIVERSITY");
outtextxy(getmaxx()/2, 3, "MAIN CAMPUS");
settextstyle (3,0,10);
outtextxy (getmaxx()/2, 5, "College of Engineering and Architecture");
outtextxy (getmaxx()/2, 7, "Bachelor of Science in Civil Engineering(BSCE)");
settextstyle (3,0,15);
outtextxy (getmaxx()/2, getmaxy()/2, "COMPUTERIZED TUTORIAL SYSTEM");
outtextxy (getmaxx()/2, 30, "(CORRECTION IN TAPING)");
settextstyle (3,0,10);
outtextxy (getmaxx()/2, getmaxy(), "Programmed by: BSCE-3A Group 8");
getch();
closegraph();
}
Upvotes: 2
Views: 295
Reputation: 11
In initgrapgh, your "" are empty. They should have the path to the bgi library. It should look something like this:
initgraph(&gd, &gm, "C:\\TC\\BGI");
Upvotes: 1