please help me.... guys.....
i want to know how to make a calculator in turbo c.
thanks....

please help me.... guys.....
i want to know how to make a calculator in turbo c.
thanks....

try this code.

#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
void box(int x, int xx, int y, int yy);
void box(int x, int xx, int y, int yy)
{
int xs,ys,i,j;
xs=xx-x;
ys=yy-y;
for(i=1; i<xs; i++){gotoxy(x+i,y);printf("%c",205);
		    gotoxy(x+i,yy);printf("%c",205);}
for(j=1; j<ys; j++){gotoxy(x,y+j);printf("%c",186);}
for(j=1; j<ys; j++){gotoxy(xx,y+j);printf("%c",186);}
		   {gotoxy(x,y);printf("%c",201);
		    gotoxy(x,yy);printf("%c",200);
		    gotoxy(xx,y);printf("%c",187);
		    gotoxy(xx,yy);printf("%c",188);}

}
void main()
{
clrscr();
box(20,60,1,25);
box(23,57,2,7);gotoxy(37,4);printf("IPHONE");
box(23,29,8,11);gotoxy(26,9);printf("7");
box(23,29,12,15);gotoxy(26,13);printf("4");
box(23,29,16,19);gotoxy(26,17);printf("1");
box(23,29,20,23);gotoxy(26,21);printf("0");
box(31,37,8,11);gotoxy(34,9);printf("8");
box(31,37,12,15);gotoxy(34,13);printf("5");
box(31,37,16,19);gotoxy(34,17);printf("2");
box(31,37,20,23);gotoxy(34,21);printf(".");
box(39,45,8,11);gotoxy(42,9);printf("9");
box(39,45,12,15);gotoxy(42,13);printf("6");
box(39,45,16,19);gotoxy(42,17);printf("3");
box(39,45,20,23);gotoxy(42,21);printf("=");
box(47,57,8,11);gotoxy(52,9);printf("/");
box(47,57,12,15);gotoxy(52,13);printf("X");
box(47,57,16,19);gotoxy(52,17);printf("-");
box(47,57,20,23);gotoxy(52,21);printf("+");
getch();
}

Edited 6 Years Ago by Nick Evan: Added code-tags

Comments
gotoxy is a Turbo C-specific function.
gotoxy() not declared.

Line 24: box(23,57,2,7);gotoxy(37,4);printf("IPHONE"); I actually ran it to see if the calculator looks good. It does... :icon_smile:

Comments
This article has been dead for over six months. Start a new discussion instead.