summaryrefslogtreecommitdiff
path: root/3808/CH2/EX2.11/Ex2_11.sce
blob: a7f25a50f0edf20202823c774b5540253425ae49 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//Chapter 02:Basic Structures: Sets, Functions, Sequences, Sums and Matrices

clc;
clear;

//Finding the summation of j**2
up=input("Enter the upper limit for the operation j**2:");
low=input("Enter the lower limit for the operation j**2:");
sum_j=0
mprintf("\nThe square of terms from 1 to n :\n")
for j=low:up 
mprintf("%d **2 +",j),
    j=j**2 
    sum_j=sum_j+j
end
mprintf("=%d",sum_j)