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

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

Phillip Thomas LAB 2 ME 218 UN: 18085 1.1 1.2

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

View Full Document
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; }

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

View Full Document
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");

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 06/23/2011 for the course ME 218 taught by Professor Unknown during the Fall '08 term at University of Texas.

Page1 / 7

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

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

View Full Document
Ask a homework question - tutors are online