954,499 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Program a Calculator Using Turbo C

Iam a freshmen and we're given a task to program a calendar using turbo C
and does'nt exceed line 54 and some texts are with specific colors.(red) for the days under sunday,(light gray)for the month....
I will really appreciate your help thanks.......
Here's the format:

ex:
enter month:1

january 2004 (lightgray)

s m t w th f s
1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31

try again[y/n]?

aya_brea
Newbie Poster
1 post since Aug 2004
Reputation Points: 10
Solved Threads: 0
 

If you bothered to read the last week or so of posts then you would have seen that I gave a complete implementation for something like this. You could easily modify that or use it as a basis for your own implementation. But no, you wanted someone to do your homework to your exact specifications. Anything else would require real work. :mad:

Narue
Bad Cop
Administrator
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401
 
If you bothered to read the last week or so of posts then you would have seen that I gave a complete implementation for something like this. You could easily modify that or use it as a basis for your own implementation. But no, you wanted someone to do your homework to your exact specifications. Anything else would require real work. :mad:

Thank you, Narue.

We, at Daniweb, don't do your homework for you-- we're here as a resource to help, not to cheat. If you want our assistance, please write some code and post it here, and then our members will help you troubleshoot it.

Thanks for your cooperation.

alc6379
Cookie... That's it
Team Colleague
2,820 posts since Dec 2003
Reputation Points: 186
Solved Threads: 147
 

ok i have made a calculator using turbo c but it keeps disappearing when i choose the run command can any body help me please

#include<stdio.h>
#include<conio.h>
int sum (int x,int y)
{
int z;
z=x+y;
return z;
}
int sub (int x,int y)
{
int z ;
z=x-y;
return z;
}
int mult (int x,int y)
{
int z;
z=x*y;
return z;
}
float dev (int x,int y)
{
float z;
z=x/y;
return z;
}
void main ()
{
int a,b,c;
int d;
clrscr();
printf("enter the first integer");
scanf("%d",&a);
printf("enter the second integer");
scanf("%d",&b);
 int i=1;
printf("what kined of operation do you wanna apply .please choose from the list:\n%d)addition(+)\n%d)subtract(-)\n%d)multiplitation(*)\n%d)division(/)",i,i+1,i+2,i+3);
scanf("%d",&c);
switch (c)
{
case '1' :
d=sum(a,b);
printf("%d + %d = %d",a,b,d);
break;
case '2':
d=sub(a,b);
printf("%d - %d = %d",a,b,d);
break;
case '3':
d=mult(a,b);
printf("%d * %d = %d",a,b,d);
break;
case '4' :
if (b>0) {
d=dev(a,b);
printf("%d / %d = %d",a,b,d);
}
else if (b<0)
{
d=dev(a,b);
printf("%d / %d = %d",a,b,d);
}
break;
}
getch();
}
THEOUTLANDER
Newbie Poster
1 post since Oct 2009
Reputation Points: 10
Solved Threads: 0
 

hi friend just remove void from main, and then try. I hope this will work

anuischamp
Newbie Poster
1 post since Oct 2009
Reputation Points: 10
Solved Threads: 0
 
ok i have made a calculator using turbo c but it keeps disappearing when i choose the run command can any body help me please


Maybe if you USE CODE TAGS and Format your Code we might be able to help you. But your code is unreadable without formatting.

WaltP
Posting Sage w/ dash of thyme
Moderator
10,506 posts since May 2006
Reputation Points: 3,348
Solved Threads: 944
 
ok i have made a calculator using turbo c but it keeps disappearing when i choose the run command can any body help me please


Well congratulations on bumping a five year old thread. In future, start a new thread.

yellowSnow
Posting Whiz in Training
203 posts since Jul 2009
Reputation Points: 651
Solved Threads: 35
 

pls. help me.. i need a usable program for my project in computer programing..using turbo C..tnx

jethro john
Newbie Poster
2 posts since Jan 2010
Reputation Points: 4
Solved Threads: 0
 
hi friend just remove void from main, and then try. I hope this will work


its not working

i already tried his code but its not working

linkin_toshiro
Newbie Poster
1 post since Feb 2010
Reputation Points: 10
Solved Threads: 0
 

@linkin_toshiro and jethro john
1) Please do not reopen old threads if you want to just ask question of your own
2) You will not get ready made codes here as we have following rule We only give homework help to those who show effort
3) If you wish to ask a question please create nde thread
4) Thread closed

peter_budo
Code tags enforcer
Moderator
15,436 posts since Dec 2004
Reputation Points: 2,806
Solved Threads: 902
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You