944,061 Members | Top Members by Rank

Ad:
  • C Discussion Thread
  • Unsolved
  • Views: 22774
  • C RSS
Sep 29th, 2004
-4

Program a Calculator Using Turbo C

Expand Post »
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]?
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
aya_brea is offline Offline
1 posts
since Aug 2004
Sep 29th, 2004
0

Re: Program a Calculator Using Turbo C

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:
Administrator
Reputation Points: 6442
Solved Threads: 1393
Bad Cop
Narue is offline Offline
11,807 posts
since Sep 2004
Sep 29th, 2004
0

Re: Program a Calculator Using Turbo C

Quote originally posted by Narue ...
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.
Team Colleague
Reputation Points: 186
Solved Threads: 147
Cookie... That's it
alc6379 is offline Offline
2,519 posts
since Dec 2003
Oct 26th, 2009
-3
Re: Program a Calculator Using Turbo C
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
  1. #include<stdio.h>
  2. #include<conio.h>
  3. int sum (int x,int y)
  4. {
  5. int z;
  6. z=x+y;
  7. return z;
  8. }
  9. int sub (int x,int y)
  10. {
  11. int z ;
  12. z=x-y;
  13. return z;
  14. }
  15. int mult (int x,int y)
  16. {
  17. int z;
  18. z=x*y;
  19. return z;
  20. }
  21. float dev (int x,int y)
  22. {
  23. float z;
  24. z=x/y;
  25. return z;
  26. }
  27. void main ()
  28. {
  29. int a,b,c;
  30. int d;
  31. clrscr();
  32. printf("enter the first integer");
  33. scanf("%d",&a);
  34. printf("enter the second integer");
  35. scanf("%d",&b);
  36. int i=1;
  37. 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);
  38. scanf("%d",&c);
  39. switch (c)
  40. {
  41. case '1' :
  42. d=sum(a,b);
  43. printf("%d + %d = %d",a,b,d);
  44. break;
  45. case '2':
  46. d=sub(a,b);
  47. printf("%d - %d = %d",a,b,d);
  48. break;
  49. case '3':
  50. d=mult(a,b);
  51. printf("%d * %d = %d",a,b,d);
  52. break;
  53. case '4' :
  54. if (b>0) {
  55. d=dev(a,b);
  56. printf("%d / %d = %d",a,b,d);
  57. }
  58. else if (b<0)
  59. {
  60. d=dev(a,b);
  61. printf("%d / %d = %d",a,b,d);
  62. }
  63. break;
  64. }
  65. getch();
  66. }
Last edited by WaltP; Oct 27th, 2009 at 3:35 am. Reason: Added CODE tags -- with all the help about them, how could you miss using them????
Reputation Points: 10
Solved Threads: 0
Newbie Poster
THEOUTLANDER is offline Offline
1 posts
since Oct 2009
Oct 27th, 2009
-1
Re: Program a Calculator Using Turbo C
hi friend just remove void from main, and then try. I hope this will work
Reputation Points: 10
Solved Threads: 0
Newbie Poster
anuischamp is offline Offline
1 posts
since Oct 2009
Oct 27th, 2009
0
Re: Program a Calculator Using Turbo C
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.
Moderator
Reputation Points: 3281
Solved Threads: 894
Posting Sage
WaltP is offline Offline
7,747 posts
since May 2006
Oct 27th, 2009
1
Re: Program a Calculator Using Turbo C
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.
Reputation Points: 651
Solved Threads: 35
Posting Whiz in Training
yellowSnow is offline Offline
201 posts
since Jul 2009
Jan 8th, 2010
-3
Re: Program a Calculator Using Turbo C
pls. help me.. i need a usable program for my project in computer programing..using turbo C..tnx
Reputation Points: 4
Solved Threads: 0
Newbie Poster
jethro john is offline Offline
2 posts
since Jan 2010
Feb 15th, 2010
0
Re: Program a Calculator Using Turbo C
Click to Expand / Collapse  Quote originally posted by anuischamp ...
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
Reputation Points: 10
Solved Threads: 0
Newbie Poster
linkin_toshiro is offline Offline
1 posts
since Feb 2010
Feb 16th, 2010
0
Re: Program a Calculator Using Turbo C
@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
Moderator
Featured Poster
Reputation Points: 2786
Solved Threads: 874
Code tags enforcer
peter_budo is offline Offline
6,659 posts
since Dec 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
This thread is currently closed and is not accepting any new replies.
Previous Thread in C Forum Timeline: Troubleshoot c
Next Thread in C Forum Timeline: array problem





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC