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/CH10/EX10.1/exm10_1.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/CH10/EX10.1/exm10_1.sce')
-rwxr-xr-x | 659/CH10/EX10.1/exm10_1.sce | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/659/CH10/EX10.1/exm10_1.sce b/659/CH10/EX10.1/exm10_1.sce new file mode 100755 index 000000000..a95e1c22f --- /dev/null +++ b/659/CH10/EX10.1/exm10_1.sce @@ -0,0 +1,18 @@ +// Example 10.1
+//Define a structure type,struct personal that would contain person name,-
+// date of joining and salary. Write a program to read this information from
+// keyboard and print same on the screen.
+
+funcprot(0);
+function [ ]=struc(n,d,m,y,s)
+ //Defining structure members
+ personal=struct('name',n,'day',d,'month',m,'year',y,'salary',s);
+ person=personal;
+ //Accessing structure members
+printf(" %s %d %s %d %.2f",person.name,person.day,person.month,person.year,person.salary);
+endfunction
+disp("Input values[Name day month year and salary]");
+//Reading data
+[name,day,month,year,salary]=scanf("%s %d %s %d %f");
+//Calling function struc()
+struc(name,day,month,year,salary);
\ No newline at end of file |