diff options
author | priyanka | 2015-06-24 15:03:17 +0530 |
---|---|---|
committer | priyanka | 2015-06-24 15:03:17 +0530 |
commit | b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch) | |
tree | ab291cffc65280e58ac82470ba63fbcca7805165 /659/CH2/EX2.4/exm2_4.sce | |
download | Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.gz Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.bz2 Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.zip |
initial commit / add all books
Diffstat (limited to '659/CH2/EX2.4/exm2_4.sce')
-rwxr-xr-x | 659/CH2/EX2.4/exm2_4.sce | 13 |
1 files changed, 13 insertions, 0 deletions
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
|