Successfully reported this slideshow.

# Hello can someone write this in a --C PROGRAM-- I am having difficulty.docx

Hello can someone write this in a \"C PROGRAM\" I am having difficulty writing this program.

Chuckie lucky won a million dollars, which he places in an account that earns 8% a year. On the last day of each year, Chuckie withdraws \$100,000. Write a program that finds out how many years it takes for Chuckie to empty his account.

Thanks.
Solution
#include <stdio.h>
int main(void)
{
double balance = 1.0e6;
unsigned int years = 0;

while (balance > 0.00)
{
balance = balance * 1.08;
balance = balance - 1.0e5;
years++;
}

printf(\"\ years = %ld balance = %lf\ \",&years,&balance);
return 0;
}
.

Hello can someone write this in a \"C PROGRAM\" I am having difficulty writing this program.

Chuckie lucky won a million dollars, which he places in an account that earns 8% a year. On the last day of each year, Chuckie withdraws \$100,000. Write a program that finds out how many years it takes for Chuckie to empty his account.

Thanks.
Solution
#include <stdio.h>
int main(void)
{
double balance = 1.0e6;
unsigned int years = 0;

while (balance > 0.00)
{
balance = balance * 1.08;
balance = balance - 1.0e5;
years++;
}

printf(\"\ years = %ld balance = %lf\ \",&years,&balance);
return 0;
}
.