Create Calculator in Turbo C++ with Graphics Mode

#include<stdio.h>
#include<conio.h>
#include<graphics.h>
#include<dos.h>
#include<stdlib.h>
#include<math.h>
#include<string.h>
#define MAX_LONG 2147483647
#define PI 3.1415926536

char buf[80];
void output(char *);
void OUTPUT(long double &);

……………………………………

void main(){

int gdriver = DETECT, gmode, errorcode;
int i ,run1=0, run2=0;
int a,k=0,l,i1=0,i2,k1=0 ,length , result=0,th=0,step;
int d[30] , Back=0 ,index = 0, NamePoint=0,ind=0,mcl=0;
long double p=0, b[2] = {0,0}, t ;
char NumBer[30],*num[30],ch,buf[80];

/* initialize graphics mode */
initgraph(&gdriver, &gmode, “C:\\TC\\BGI”);

/* read result of initialization */
errorcode = graphresult();

if (errorcode != grOk)  /* an error occurred */
{
printf(“Graphics error: %s\n”, grapherrormsg(errorcode));
printf(“Press any key to halt:”);
getch();
exit(1);             /* return with error code */

}

……………………………………

Download Source Code

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: