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/CH4/EX4.11/exm4_11.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/CH4/EX4.11/exm4_11.sce')
-rwxr-xr-x | 659/CH4/EX4.11/exm4_11.sce | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/659/CH4/EX4.11/exm4_11.sce b/659/CH4/EX4.11/exm4_11.sce new file mode 100755 index 000000000..7e17ec7b8 --- /dev/null +++ b/659/CH4/EX4.11/exm4_11.sce @@ -0,0 +1,16 @@ +// Example 4.11
+// The program illustrates the printing of character and strings.
+
+x='A'; //x variable has character
+name='ANIL KUMAR GUPTA'; //name variable has string
+disp("OUTPUT OF CHARACTERS");
+printf('%c\n%3c\n%5c\n',x,x,x);
+printf('%3c\n%c\n',x,x);
+printf('\n');
+disp("OUTPUT OF STRINGS"); //disp can also be used for display
+printf('%s\n',name);
+printf('%20s\n',name);
+printf('%20.10s\n',name);
+printf('%.5s\n',name);
+printf('%-20.10s\n',name);
+printf('%5s\n',name);
|