diff options
Diffstat (limited to '659/CH7/EX7.4/exm7_4.sce')
-rwxr-xr-x | 659/CH7/EX7.4/exm7_4.sce | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/659/CH7/EX7.4/exm7_4.sce b/659/CH7/EX7.4/exm7_4.sce new file mode 100755 index 000000000..857d99a74 --- /dev/null +++ b/659/CH7/EX7.4/exm7_4.sce @@ -0,0 +1,18 @@ +// Example:7.4
+//Write a program to compute and print a multiplication table for numbers 1 to 5
+
+ROWS=5;COLUMNS=5;
+disp("MULTIPLICATION TABLE");
+printf("*|")
+for j=1:COLUMNS
+ printf("%4d",j);
+end
+disp("________________________");
+for i=1:ROWS
+ printf("%1d|",i);
+ for j=1:COLUMNS
+ product(i,j)=i*j; //Calculate the product
+ printf("%4d",product(i,j)); //Print the product
+ end
+ printf("\n");
+end
\ No newline at end of file |