blob: ac0dfaa360f216f37ea03df5d5ba1b8083e45d18 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
//chapter 6 Ex 11
clc;
clear;
close;
n=39; avg39=15;//average of 39 students
inc=3/12; //months converted to years
avg40=avg39+inc;
Sum39=avg39*n;
Sum40=avg40*(n+1);
teacherAge=Sum40-Sum39;
mprintf("The age of teacher is %d years",teacherAge);
|