The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Jul 2017 |
| Last Sign in: | 304 Weeks Ago, 5 Days Ago |
| Questions Answered: | 15833 |
| Tutorials Posted: | 15827 |
MBA,PHD, Juris Doctor
Strayer,Devery,Harvard University
Mar-1995 - Mar-2002
Manager Planning
WalMart
Mar-2001 - Feb-2009
#include <stdio.h>
#include "stdafx.h"
// function prototype
double smallest3(double a, double b, double c);
int main()
{
printf("%s", "Enter three floating point values: ");
double x; // first input
double y; // second input
double z; // third input
scanf_s("%lf%lf%lf", &x, &y, &z);
// determine smallest value
printf("The smallest value is %fn", smallest3(x, y, z));
getchar();
getchar();
}
// smallest3 returns the smallest of a, b and c
double smallest3(double a, double b, double c)
{
double smallest = a; // assume a is the smallest
if (b < smallest) { // if b is smaller
smallest = b;
}
if (c < smallest) { // if c is smaller
smallest = c;
}
return smallest; // return smallest value
}
Attachments:
----------- Â ----------- H-----------ell-----------o S-----------ir/-----------Mad-----------am ----------- Th-----------ank----------- yo-----------u f-----------or -----------you-----------r i-----------nte-----------res-----------t a-----------nd -----------buy-----------ing----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- qu-----------ick-----------ly