blob: 9a1c43b76f074832fdaf3fc6beda7d055713c878 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
|
//chapter 6 Ex 3
clc;
clear;
close;
a=[];
for i=1:20
a(i)=7*i;
end
Sum=sum(a);
Average=Sum/size(a,"r");
printf("The average of first 20 multiples of 7 is %3.2f",Average);
|