/* * ====================================================================== * Combined Resistance of Three Resistors in Parallel * * Copyright (C) 1998 by Mark Austin and David Chancogne. * * This software is provided "as is" without express or implied warranty. * Permission is granted to use this software on any computer system, * and to redistribute it freely, subject to the following restrictions: * * 1. The authors are not responsible for the consequences of use of * this software, even if they arise from defects in the software. * 2. The origin of this software must not be misrepresented, either * by explicit claim or by omission. * 3. Altered versions must be plainly marked as such, and must not * be misrepresented as being the original software. * 4. This notice is to remain intact. * * Written by : Mark Austin * ====================================================================== */ #include int main( void ) { float fR1 = 1.5F; float fR2 = 2.5F; float fR3 = 3.5F; float fCombinedResistance; /* [a] : Print properties of individual resistors */ printf( "Resistor 1 is %8.3f ohms\n", fR1 ); printf( "Resistor 2 is %8.3f ohms\n", fR2 ); printf( "Resistor 3 is %8.3f ohms\n", fR3 ); /* [b] : Compute and print combined resistance */ fCombinedResistance = 1.0 / ( 1.0/fR1 + 1.0/fR2 + 1.0/fR3 ); printf( "Combined Resistance is %8.3f ohms\n", fCombinedResistance); }