From b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b Mon Sep 17 00:00:00 2001 From: priyanka Date: Wed, 24 Jun 2015 15:03:17 +0530 Subject: initial commit / add all books --- 659/CH2/EX2.4/exm2_4.sce | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100755 659/CH2/EX2.4/exm2_4.sce (limited to '659/CH2/EX2.4/exm2_4.sce') diff --git a/659/CH2/EX2.4/exm2_4.sce b/659/CH2/EX2.4/exm2_4.sce new file mode 100755 index 000000000..3830f8d2c --- /dev/null +++ b/659/CH2/EX2.4/exm2_4.sce @@ -0,0 +1,13 @@ +// Example 2.4 +// Sample program 3(exm1.5) discussed in chapter 1 can be convered in to a more flexible intractive program using scanf() function +disp("Enter in single line separted by space"); +disp("Input amount,interest rate, and period"); +[amount,inrate,period]=scanf("%f %f %d"); //use of scanf() +year=1; +//Computation using while loop +while(year<=period) + value=amount+inrate*amount; + printf("%2d Rs %8.2f\n",year,value) + year=year+1; + amount=value; +end -- cgit