Floating point version of wreck.c(works for any depth shipwreck)
#include <stdio.h>
main ( )
{
float fathoms, feet;
printf (“Enter the depth in fathoms : ”);
scanf (“%f”, &fathoms);
feet = 6.0 * fathoms;
printf (“She’s %f feet down.\n”, feet);
}
Previous slide
Back to first slide
View graphic version