Resolved Question
C Program for Combinations
 
Details: Write a program to generate all combinations of 1,2 and 3 using for loop?
  asked by: alexxis  on: Sep 14, 2009  
 Best Answer ! ! !
esteeterri 's Answer  ( this answer is maked as best answer of this question at: Sep 16, 2009 )


for(i=1;i<4;i )
for(j=1;j<4;j )
for(k=1;k<4;k )
printf("%d%d%dn",i,j,k);
1 comments  answered on: Sep 20, 2009 
Other Answer (1)
int main ()
{
int i j k;

for(i 1;i<4;i )
{
for(j 1;j<4;j )
{
for(k 1;k<4;k )
{
if((i! j) && (j! k) && (i! k))
{
printf(" d d dn" i j k);
}
}
}
}
}
  gyhw   answered on£ºSep 15, 2009  0 comments

Hot Questions

Contact Us - IT-Interview