summaryrefslogtreecommitdiff
path: root/3492/CH3/EX3.12/Ex3_12.sce
blob: 4ab40873c7cff47a7fb41f264a59ab3296dd5636 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
clc
//Chapter3
//Ex_12
//Given
x=9
for n1=1:x
  for n2=1:x
   for n3=1:x
y=n1^2+n2^2+n3^2 //let y=N^2=n1^2+n2^2+n3^2
if (y==41) 

    mprintf('%d\t%d\t%d\n',n1    ,n2    ,n3    )
    
end;
end
end
end
disp("Thus there are nine possible states")