slide1
Download
Skip this Video
Download Presentation
/* * Converts distance in miles to kilometers. */

Loading in 2 Seconds...

play fullscreen
1 / 15

/* * Converts distance in miles to kilometers. */ - PowerPoint PPT Presentation


  • 117 Views
  • Uploaded on

/* * Converts distance in miles to kilometers. */ #include <stdio.h> /* printf, scanf definitions */ #define KMS_PER_MILE 1.609 /* conversion constant*/ int main(void) { double miles, /* input - distance in miles. */ kms; /* output - distance in kilometers */

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about ' /* * Converts distance in miles to kilometers. */' - kuame-barnett


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
slide1
/*

* Converts distance in miles to kilometers.

*/

#include <stdio.h> /* printf, scanf definitions */

#define KMS_PER_MILE 1.609 /* conversion constant*/

int

main(void)

{

double miles, /* input - distance in miles. */

kms; /* output - distance in kilometers */

/* Get the distance in miles. */

printf("Enter the distance in miles> ");

scanf("%lf", &miles);

/* Convert the distance to kilometers. */

kms = KMS_PER_MILE * miles;

/* Display the distance in kilometers. */

printf("That equals %f kilometers.\n", kms);

return (0);

}

Memory Stack

Compiled and

ready to run

slide2
/*

* Converts distance in miles to kilometers.

*/

#include <stdio.h> /* printf, scanf definitions */

#define KMS_PER_MILE 1.609 /* conversion constant*/

int

main(void)

{

double miles, /* input - distance in miles. */

kms; /* output - distance in kilometers */

/* Get the distance in miles. */

printf("Enter the distance in miles> ");

scanf("%lf", &miles);

/* Convert the distance to kilometers. */

kms = KMS_PER_MILE * miles;

/* Display the distance in kilometers. */

printf("That equals %f kilometers.\n", kms);

return (0);

}

Memory Stack

slide3
/*

* Converts distance in miles to kilometers.

*/

#include <stdio.h> /* printf, scanf definitions */

#define KMS_PER_MILE 1.609 /* conversion constant*/

int

main(void)

{

double miles, /* input - distance in miles. */

kms; /* output - distance in kilometers */

/* Get the distance in miles. */

printf("Enter the distance in miles> ");

scanf("%lf", &miles);

/* Convert the distance to kilometers. */

kms = KMS_PER_MILE * miles;

/* Display the distance in kilometers. */

printf("That equals %f kilometers.\n", kms);

return (0);

}

Memory Stack

slide4
/*

* Converts distance in miles to kilometers.

*/

#include <stdio.h> /* printf, scanf definitions */

#define KMS_PER_MILE 1.609 /* conversion constant*/

int

main(void)

{

double miles, /* input - distance in miles. */

kms; /* output - distance in kilometers */

/* Get the distance in miles. */

printf("Enter the distance in miles> ");

scanf("%lf", &miles);

/* Convert the distance to kilometers. */

kms = KMS_PER_MILE * miles;

/* Display the distance in kilometers. */

printf("That equals %f kilometers.\n", kms);

return (0);

}

Memory Stack

KMS_PER_MILE

1.609

slide5
/*

* Converts distance in miles to kilometers.

*/

#include <stdio.h> /* printf, scanf definitions */

#define KMS_PER_MILE 1.609 /* conversion constant*/

int

main(void)

{

double miles, /* input - distance in miles. */

kms; /* output - distance in kilometers */

/* Get the distance in miles. */

printf("Enter the distance in miles> ");

scanf("%lf", &miles);

/* Convert the distance to kilometers. */

kms = KMS_PER_MILE * miles;

/* Display the distance in kilometers. */

printf("That equals %f kilometers.\n", kms);

return (0);

}

Memory Stack

KMS_PER_MILE

1.609

slide6
/*

* Converts distance in miles to kilometers.

*/

#include <stdio.h> /* printf, scanf definitions */

#define KMS_PER_MILE 1.609 /* conversion constant*/

int

main(void)

{

double miles, /* input - distance in miles. */

kms; /* output - distance in kilometers */

/* Get the distance in miles. */

printf("Enter the distance in miles> ");

scanf("%lf", &miles);

/* Convert the distance to kilometers. */

kms = KMS_PER_MILE * miles;

/* Display the distance in kilometers. */

printf("That equals %f kilometers.\n", kms);

return (0);

}

Memory Stack

KMS_PER_MILE

1.609

miles

junk

kms

junk

slide7
/*

* Converts distance in miles to kilometers.

*/

#include <stdio.h> /* printf, scanf definitions */

#define KMS_PER_MILE 1.609 /* conversion constant*/

int

main(void)

{

double miles, /* input - distance in miles. */

kms; /* output - distance in kilometers */

/* Get the distance in miles. */

printf("Enter the distance in miles> ");

scanf("%lf", &miles);

/* Convert the distance to kilometers. */

kms = KMS_PER_MILE * miles;

/* Display the distance in kilometers. */

printf("That equals %f kilometers.\n", kms);

return (0);

}

Memory Stack

KMS_PER_MILE

1.609

miles

junk

kms

junk

slide8
/*

* Converts distance in miles to kilometers.

*/

#include <stdio.h> /* printf, scanf definitions */

#define KMS_PER_MILE 1.609 /* conversion constant*/

int

main(void)

{

double miles, /* input - distance in miles. */

kms; /* output - distance in kilometers */

/* Get the distance in miles. */

printf("Enter the distance in miles> ");

scanf("%lf", &miles);

/* Convert the distance to kilometers. */

kms = KMS_PER_MILE * miles;

/* Display the distance in kilometers. */

printf("That equals %f kilometers.\n", kms);

return (0);

}

Memory Stack

KMS_PER_MILE

1.609

miles

junk

kms

junk

slide9
/*

* Converts distance in miles to kilometers.

*/

#include <stdio.h> /* printf, scanf definitions */

#define KMS_PER_MILE 1.609 /* conversion constant*/

int

main(void)

{

double miles, /* input - distance in miles. */

kms; /* output - distance in kilometers */

/* Get the distance in miles. */

printf("Enter the distance in miles> ");

scanf("%lf", &miles);

/* Convert the distance to kilometers. */

kms = KMS_PER_MILE * miles;

/* Display the distance in kilometers. */

printf("That equals %f kilometers.\n", kms);

return (0);

}

Memory Stack

KMS_PER_MILE

1.609

miles

125.0

kms

junk

slide10
/*

* Converts distance in miles to kilometers.

*/

#include <stdio.h> /* printf, scanf definitions */

#define KMS_PER_MILE 1.609 /* conversion constant*/

int

main(void)

{

double miles, /* input - distance in miles. */

kms; /* output - distance in kilometers */

/* Get the distance in miles. */

printf("Enter the distance in miles> ");

scanf("%lf", &miles);

/* Convert the distance to kilometers. */

kms = KMS_PER_MILE * miles;

/* Display the distance in kilometers. */

printf("That equals %f kilometers.\n", kms);

return (0);

}

Memory Stack

KMS_PER_MILE

1.609

miles

125.0

kms

junk

slide11
/*

* Converts distance in miles to kilometers.

*/

#include <stdio.h> /* printf, scanf definitions */

#define KMS_PER_MILE 1.609 /* conversion constant*/

int

main(void)

{

double miles, /* input - distance in miles. */

kms; /* output - distance in kilometers */

/* Get the distance in miles. */

printf("Enter the distance in miles> ");

scanf("%lf", &miles);

/* Convert the distance to kilometers. */

kms = KMS_PER_MILE * miles;

/* Display the distance in kilometers. */

printf("That equals %f kilometers.\n", kms);

return (0);

}

Memory Stack

KMS_PER_MILE

1.609

miles

125.0

kms

201.125

slide12
/*

* Converts distance in miles to kilometers.

*/

#include <stdio.h> /* printf, scanf definitions */

#define KMS_PER_MILE 1.609 /* conversion constant*/

int

main(void)

{

double miles, /* input - distance in miles. */

kms; /* output - distance in kilometers */

/* Get the distance in miles. */

printf("Enter the distance in miles> ");

scanf("%lf", &miles);

/* Convert the distance to kilometers. */

kms = KMS_PER_MILE * miles;

/* Display the distance in kilometers. */

printf("That equals %f kilometers.\n", kms);

return (0);

}

Memory Stack

KMS_PER_MILE

1.609

miles

125.0

kms

201.125

slide13
/*

* Converts distance in miles to kilometers.

*/

#include <stdio.h> /* printf, scanf definitions */

#define KMS_PER_MILE 1.609 /* conversion constant*/

int

main(void)

{

double miles, /* input - distance in miles. */

kms; /* output - distance in kilometers */

/* Get the distance in miles. */

printf("Enter the distance in miles> ");

scanf("%lf", &miles);

/* Convert the distance to kilometers. */

kms = KMS_PER_MILE * miles;

/* Display the distance in kilometers. */

printf("That equals %f kilometers.\n", kms);

return (0);

}

Memory Stack

KMS_PER_MILE

1.609

miles

125.0

kms

201.125

slide14
/*

* Converts distance in miles to kilometers.

*/

#include <stdio.h> /* printf, scanf definitions */

#define KMS_PER_MILE 1.609 /* conversion constant*/

int

main(void)

{

double miles, /* input - distance in miles. */

kms; /* output - distance in kilometers */

/* Get the distance in miles. */

printf("Enter the distance in miles> ");

scanf("%lf", &miles);

/* Convert the distance to kilometers. */

kms = KMS_PER_MILE * miles;

/* Display the distance in kilometers. */

printf("That equals %f kilometers.\n", kms);

return (0);

}

Memory Stack

KMS_PER_MILE

1.609

miles

125.0

kms

201.125

slide15
/*

* Converts distance in miles to kilometers.

*/

#include <stdio.h> /* printf, scanf definitions */

#define KMS_PER_MILE 1.609 /* conversion constant*/

int

main(void)

{

double miles, /* input - distance in miles. */

kms; /* output - distance in kilometers */

/* Get the distance in miles. */

printf("Enter the distance in miles> ");

scanf("%lf", &miles);

/* Convert the distance to kilometers. */

kms = KMS_PER_MILE * miles;

/* Display the distance in kilometers. */

printf("That equals %f kilometers.\n", kms);

return (0);

}

Memory Stack

ad