diff options
Diffstat (limited to '3808/CH2/EX2.12/Ex2_12.sce')
-rw-r--r-- | 3808/CH2/EX2.12/Ex2_12.sce | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/3808/CH2/EX2.12/Ex2_12.sce b/3808/CH2/EX2.12/Ex2_12.sce new file mode 100644 index 000000000..3b386f954 --- /dev/null +++ b/3808/CH2/EX2.12/Ex2_12.sce @@ -0,0 +1,17 @@ +//Chapter 02:Basic Structures: Sets, Functions, Sequences, Sums and Matrices + +clc; +clear; + +k=4 //lower limit +sum_a=0 +mprintf("The value for the sequence ") +for k=4:8 + if (k==8) then + mprintf("(-1) ** %d ",k) + else + mprintf("(-1) ** %d +",k) +end +sum_a=sum_a + ((-1) ** k) +end +mprintf("=%d",sum_a) |