diff options
Diffstat (limited to '659/CH10/EX10.1')
-rwxr-xr-x | 659/CH10/EX10.1/exm10_1.sce | 18 | ||||
-rwxr-xr-x | 659/CH10/EX10.1/exm10_1_output.PNG | bin | 0 -> 7462 bytes |
2 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 diff --git a/659/CH10/EX10.1/exm10_1_output.PNG b/659/CH10/EX10.1/exm10_1_output.PNG Binary files differnew file mode 100755 index 000000000..5e60f8779 --- /dev/null +++ b/659/CH10/EX10.1/exm10_1_output.PNG |