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 /1034/CH2/EX2.3 | |
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 '1034/CH2/EX2.3')
-rwxr-xr-x | 1034/CH2/EX2.3/example3.sce | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/1034/CH2/EX2.3/example3.sce b/1034/CH2/EX2.3/example3.sce new file mode 100755 index 000000000..46eabc92f --- /dev/null +++ b/1034/CH2/EX2.3/example3.sce @@ -0,0 +1,28 @@ +clear;
+clc;
+printf("\nExample 2.3\n");
+// comparision of 2 strings.
+a="hakunah";..........//string 1.
+b="matata";.............//string 2.
+disp(" a & b respectively are =");
+disp(a);
+disp(b);
+disp("comparing strings");
+z=strcmp(a,b);.........//comparision of 2 strings.
+if(z==0)
+ printf("\nMATCHED\n");.......// if strings matched strcmp returns 0.
+else
+ printf("\nNOT MATCHED\n");.........// if string doesn't matched strcmp returns -1.
+ end
+ q="akash";
+ w="akash";
+ disp("q & w respectively are=");
+ disp(q);
+ disp(w);
+ disp("comparing strings");
+ x=strcmp(q,w);
+ if(x==0)
+ printf("\nMATCHED\n");.......// if strings matched strcmp returns 0.
+else
+ printf("\nNOT MATCHED\n");.........// if string doesn't matched strcmp returns -1.
+ end
\ No newline at end of file |