#include <stdio.h>
#define LOWER 0 /* lower limit of table */
#define UPPER 300 /* upper limit */
#define STEP 20 /* step size */
/* print Fahrenheit-Celsius table */
main()
{
int fahr;
for (fahr = LOWER; fahr <= UPPER; fahr = fahr + STEP)
printf("%3d %6.1f\n", fahr, (5.0/9.0)*(fahr-32));
}
Using Symbolic Constraints we are not throwing magic numbers into the program. This method makes it a lot easier to hand this code off to another programmer he can jump right into editing it even without a synopsis of what it does. Not nearly as complicated as the encryption program but this is where I am at so its cool. I am almost on chapter two of my C Programming book!
Hey! Nice stuff, never managed to learn C++, good job.
ReplyDeleteYou should learn fortran. Its seriously the most useful programming out there I think. I don't get why more people don't use it.
ReplyDeleteThat is a very basic program... you should add it conversion to Kelvin.
ReplyDeletethis C, or C++?
ReplyDeletecool now i know
ReplyDeleteHow do I go about making a simple program out of this in DOS or something. I'm constantly googling temperature conversion rates and it's pathetic lol
ReplyDeletehow many chapters you got left in your C programming book?
ReplyDeletei certainly remember doing something similar to this in first year classes, fun times :)
ReplyDeleteGood info, I gave up on programming haha.
ReplyDeleteDelicious, it's always a pain to try and convert it yourself.
ReplyDeleteI tried learning pearl once
ReplyDeleteI have always wanted to learn a programming language. I hear C/C++ are quite popular. I use a lot of applications but to truly appreciate the effort put into these I would need to learn how to code.
ReplyDeleteI tried to teach myself C one time. I kinda lost interest after 3 days, I kind of burned myself out though tbh, I didn't do anything else.
ReplyDeleteAh the wonders of CS. I was forced to learn this weird language called netlogo back in high school lol
ReplyDeleteThis could actually be very useful, thanks for sharing.
ReplyDeleteohh this gave me a headache at uni last year... nice blog ;)
ReplyDeletethis is C++ right?
ReplyDeletepretty cool program
ReplyDeletehmmm....all I know is some highschool PASCAL, but it still makes some sense to me.
ReplyDeleteGaahh, I love how the pre-processor does any math it can before compiling
ReplyDeleteGood place to start, once you get a hand of arrays and such you'll be creating all sorts of cool stuff.
ReplyDeleteHear anything about C#? It's fairly new, but I don't know much about it.
ReplyDeleteCool stuff man thanks!
ReplyDeletenice job dude!! im going to save the code..thanks
ReplyDeletekeep it up, u'll catch up in no time, C is the very base of a programmer
ReplyDeleteawesome stuff thanks for sharing!
ReplyDeleteThanks for sharing, need to brush up on my coding.
ReplyDeleteI'll show this to my brother. It will benefit him more than myself. This goes straight over my head hah.
ReplyDeleteNice share, I think I'm gonna start learning how to program more
ReplyDeletenice job.
ReplyDeleteHaven't compiled any code in a while so I'll have to try this out.
Im learning C# at the moment, would love to see any kind of post about it
ReplyDeleteDO IT WITH JAVA! lol jk
ReplyDeleteNice... coding is fun
ReplyDeleteCool, this helped me
ReplyDelete:D I'm learning C programming @ school, Followed!
ReplyDeleteGood to know.
ReplyDeleteIt seems so simple, but this would take me quite awhile to figure out.
ReplyDeleteYesss a blog with C on it.
ReplyDeleteFollowing,
U Laugh U Lose
http://ulaughulose.blogspot.com/
I don't completely understand this, but I'm still learning!
ReplyDeletegreat stuff, need this on a phone app!
ReplyDeleteI wish I could get computer programming easier
ReplyDeleteCool stuff! I'm learning really basic programming in class right now. Hope to learn C someday. Good luck! New Follower!
ReplyDeleteFollow me at
http://finallytwenty-one.blogspot.com/
Bro, your shit is hot and your code is Tight!! I'm following you in the hopes of absorbing some of that skillful goodness.
ReplyDelete