diff options
Diffstat (limited to '659/CH4/EX4.10/exm4_10.sce')
-rwxr-xr-x | 659/CH4/EX4.10/exm4_10.sce | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/659/CH4/EX4.10/exm4_10.sce b/659/CH4/EX4.10/exm4_10.sce new file mode 100755 index 000000000..c6fdebbcb --- /dev/null +++ b/659/CH4/EX4.10/exm4_10.sce @@ -0,0 +1,16 @@ +// Example 4.10
+// The program illustrates all the options of printing a real number.
+
+y=98.7654; //real number
+//Various options of printing a real number
+printf('%7.4f\n',y);
+printf('%f\n',y);
+printf('%7.2f\n',y);
+printf('%-7.2f\n',y);
+printf('%07.2f\n',y);
+printf('%7.2f\n',y);
+printf('\n');
+printf('%10.2e\n',y);
+printf('%12.4e\n',-y);
+printf('%-10.2e\n',y);
+printf('%e\n',y);
\ No newline at end of file |