blob: 486612b5146e6bf44eb84f0d77481f56d34e809b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
|
//Chapter 32 Ex 5
clc;
close;
clear;
//according to prob statement and forming the equation considering sum as x we get (x/2)+(2x/5)-(8x/9)=40 and solving equation
for x=1:5000
if (x/2)+((2*x)/5)-((8*x)/9)==40
break;
end
end
mprintf("The amount of the bill is Rs %d",x);
|