Thursday, May 1, 2008

Write a program to generate all combinations of 1, 2 and 3 using for loops.

# SS26

# Shell script to generate all combinations of 1 2 3

# Usage: SS26

clear

for in 1 2 3

do

for j in 1 2 3

do

for k in 1 2 3

do

echo $i $j $k

done

done

done

5 comments:

Anonymous said...

In this program you forget take i in the first for loop....

Anonymous said...

Hi! Thanks for this program. I found it useful in need!

Anonymous said...

Hi! Thanks for this program. I found it useful in need!

Unknown said...

this is not the generalised program this program is specific only for 123

Unknown said...

I am unable to understand the logic of this program