Successfully reported this slideshow.
Your SlideShare is downloading. ×

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

Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad

Check these out next

1 of 2 Ad

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

Download to read offline

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;
}
.

Advertisement
Advertisement

More Related Content

More from rtodd588 (20)

Recently uploaded (20)

Advertisement

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

  1. 1. 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; }

×