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

Recommended Answers

All 12 Replies

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();
}
commented: gotoxy() not declared. -2
commented: gotoxy is a Turbo C-specific function. +26

try this code.

But he wants it for the computer, not the iPhone... :D

But he wants it for the computer, not the iPhone... :D

How can you tell that code is for iPhone?

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:

commented: Good. +26

Of course looks mean nothing if the program doesn't do anything but display a pretty picture.

I assume that was up to the OP...

how to make sample program for turbo c++?

@junemowar: Are you blind, or just plain stupid ?

i want to know that how to add graphics in calculator??/

Folk that were chatting here may never come back to you.

Particularly Ancient Dragon.

We miss you Mel.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.