Welcome To The World Of Hacking


Learn Hacking|Teach Hacking|Learn To Secure|Learn To Code

Saturday

JAVA PROGRAMMING TUTORIAL 17: COMPOUND INTEREST

public class HackDefence{

       public static void main(String[]args){

             double amount;

             double principal=1000;

             double rate= 0.01;

              for(int day=1; day<5;day++){

                 amount=principal*Math.pow(1+rate,day);

                 System.out.println(day+"  "+ amount);

}

}

}

OUTPUT:

No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...