Program a Calculator Using Turbo C

Reply

Join Date: Aug 2004
Posts: 1
Reputation: aya_brea is an unknown quantity at this point 
Solved Threads: 0
aya_brea aya_brea is offline Offline
Newbie Poster

Program a Calculator Using Turbo C

 
0
  #1
Sep 29th, 2004
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]?
Reply With Quote Quick reply to this message  
Join Date: Sep 2004
Posts: 7,596
Reputation: Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute 
Solved Threads: 712
Team Colleague
Narue's Avatar
Narue Narue is offline Offline
Code Goddess

Re: Program a Calculator Using Turbo C

 
0
  #2
Sep 29th, 2004
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:
Reply With Quote Quick reply to this message  
Join Date: Dec 2003
Posts: 2,414
Reputation: alc6379 has a spectacular aura about alc6379 has a spectacular aura about alc6379 has a spectacular aura about 
Solved Threads: 123
Team Colleague
alc6379's Avatar
alc6379 alc6379 is offline Offline
Cookie... That's it

Re: Program a Calculator Using Turbo C

 
0
  #3
Sep 29th, 2004
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.
Alex Cavnar, aka alc6379
Reply With Quote Quick reply to this message  
Join Date: Oct 2009
Posts: 1
Reputation: THEOUTLANDER is an unknown quantity at this point 
Solved Threads: 0
THEOUTLANDER THEOUTLANDER is offline Offline
Newbie Poster
 
-1
  #4
29 Days Ago
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; 29 Days Ago at 3:35 am. Reason: Added CODE tags -- with all the help about them, how could you miss using them????
Reply With Quote Quick reply to this message  
Join Date: Oct 2009
Posts: 1
Reputation: anuischamp is an unknown quantity at this point 
Solved Threads: 0
anuischamp anuischamp is offline Offline
Newbie Poster
 
-1
  #5
29 Days Ago
hi friend just remove void from main, and then try. I hope this will work
Reply With Quote Quick reply to this message  
Join Date: May 2006
Posts: 3,114
Reputation: WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of 
Solved Threads: 281
Moderator
WaltP's Avatar
WaltP WaltP is offline Offline
Posting Sensei
 
0
  #6
29 Days Ago
Originally Posted by THEOUTLANDER View Post
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.
The 3 Laws of the Procrastination Society:
1) Never do today that which can be put off until tomorrow
2) Tomorrow never comes
Reply With Quote Quick reply to this message  
Join Date: Jul 2009
Posts: 201
Reputation: yellowSnow is a splendid one to behold yellowSnow is a splendid one to behold yellowSnow is a splendid one to behold yellowSnow is a splendid one to behold yellowSnow is a splendid one to behold yellowSnow is a splendid one to behold yellowSnow is a splendid one to behold 
Solved Threads: 35
yellowSnow's Avatar
yellowSnow yellowSnow is offline Offline
Posting Whiz in Training
 
0
  #7
29 Days Ago
Originally Posted by THEOUTLANDER View Post
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.
Manic twiddler of bits
Reply With Quote Quick reply to this message  
Reply

Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC