Lab 2 - Phillip Thomas ME 218 UN: 18085 1.1 LAB 2 1.2 1.3...

Info iconThis preview shows pages 1–7. Sign up to view the full content.

View Full Document Right Arrow Icon
Phillip Thomas LAB 2 ME 218 UN: 18085 1.1 1.2
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
1.3 #include "stdio.h" #define year1 2008 #define month1 9 int age1, age3, age2; float year2, month2, age4; void main() { printf("Enter the year you were born: \n"); scanf("%f", &year2); printf("Enter the month you were born: \n"); scanf("%f", &month2); age1= (year1-year2)*12+month1-month2; age4=((year1-year2)*12+month1-month2)/12; age2= age1/12; age3= age1%12; printf("\nYour current age in years is: %0.3f \n", age4); printf("\nYour current age in months is: %0.0d \n", age1); printf("\nYour current age is %d years and %0.0d months \n", age2, age3 ); return; }
Background image of page 2
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
1.4 1.5 #include "stdio.h" double mph, a; double MPHtoMetric(double mph); void main() { printf("Enter the speed in miles per hour:\n");
Background image of page 4
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 6
Background image of page 7
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 7

Lab 2 - Phillip Thomas ME 218 UN: 18085 1.1 LAB 2 1.2 1.3...

This preview shows document pages 1 - 7. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online