Page Rank Checker

Saturday 5 July 2014

Minimum Life For Attractive Investment Program In C


This article is from solution of Let Us C by Yashwant Kanetkar. I also posted many another articles regarding solutions of Let Us C. If you have any problem regarding solution then give comment, I will surely reply your question.

Q. A machine is purchased which will produce earning of Rs. 1000 per year while it lasts. The machine costs Rs. 6000 and  will have a salvage value of Rs.2000 when it is condemned. If 12 percent per annum can be earned on alternate investments What will be the minimum life of the machine to make it more attractive investment compared to alternate investment?

Ans.

#include<stdio.h>
#include<conio.h>
void main()
{
    clrscr();
    int mchn_invst, altrnt_invst, yr=0;
    while(altrnt_invst>mchn_invst)
    {
        altrnt_invst=120*yr;
        mchn_invst=1000*yr-(6000-2000);
        yr++;
    }
    printf("Minimum life of machine to make it attractive is %d",yr);
    getch();
}