Temperataure & Distance Conversion


This brief sample demonstrates several features

/** 1 Jan. 11, 1991 ~~~~ CONVERTER.C ~~~~ Jim Engel */ /* Copyright (C) 1991 James R. Engel */ /* Long befoe C++ came into use in the 1900s, the original "C" language was the dominant language for many systems programming applications. It still is, Linux for instance is mostly written in C. "C" had it's own set of native input / output utilities that you will still see, because they are there, and because many of us grew up with them and never stopped using them, and because they have much utility. http://msdn.microsoft.com/en-us/library/zh80x809(v=VS.80).aspx This program demonstrates the original "C" printf (print formated) statement, more details in the Kernighan & Ritchie book. http://en.wikipedia.org/wiki/The_C_Programming_Language */ #include "stdafx.h" #include "stdio.h" int main( ) { float fer, cen; char outString[256]; char playerName[64] = " Woodie"; int strikeOuts = 17; printf ("\nFerenheight / Centigrate TEMPERATURE CONVERTER \n"); printf (" Feren Cent Feren Cent \n"); for ( fer = -40.; fer <= 100.0; fer += 2. ) { cen = (fer-32.)*(5./9.); printf ( " %5.1f %5.1f %5.1f %5.1f \n", fer, cen, fer+142, (fer-32.+142)*(5./9.) ); } printf ("\nMiles/Kilometer Conversion \n"); printf ("\n\n Miles KM Miles KM \n"); float mile ; for ( mile = 5.; mile <= 200.0; mile +=5. ) { printf ( " %5.1f %5.1f %5.1f %5.1f \n", mile, mile*1.61, mile +200, (mile+200) *1.61 ); } } /*END*/

Temperature/distance image