Friday, December 23, 2011

Program to


public class Ch2Q25
{
    public static void main(String[] args)
    {double mohan = 1000, vidya = 750;
    int yr = 0;
    while(vidya <= mohan)
         { mohan += 100;
           vidya += 0.075 * vidya;
           yr++;
         }
    System.out.println("\nNo of years= "+yr);
        }
}

No comments:

Post a Comment