Lab2B1 - n\n""do-while" loop do p...

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

View Full Document Right Arrow Icon
Sheet1 #include <stdio.h> #include <stdlib.h> #include <math.h> int main() { /*declare and initialize variables*/ double rate=.02 i int year=2008, n=2500, nlimit=14000 /*print variable values*/ printf("With 2500 uncut acres and 14000 acres total,\n a 2 percent reforestation " "rate over a 20 year span will produce:\
Background image of page 1

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

View Full Document Right Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: n\n") /*"do-while" loop*/ do { p printf("%i acres in %i\n\n", n, year) year = year + 1 n = n + (n*rate) }while(year <= 2028) /*exit program*/ return EXIT_SUCCESS } Page 1...
View Full Document

{[ snackBarMessage ]}

Page1 / 2

Lab2B1 - n\n""do-while" loop do p...

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

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