summaryrefslogtreecommitdiff
path: root/1553/CH6/EX6.2/6Ex2.sce
blob: b07cb08c2d42038b34561767de3b76cce1e0417e (plain)
1
2
3
4
5
6
7
8
9
//chapter 6 Ex 2

clc;
clear;
close;
n=40;
Sum=n*(n+1)/2;  //formula for sum of first n natural numbers
avg=Sum/n;
mprintf("The required average is %.1f",avg);