document.write( "Question 830568: C-program to get 35 combinations of the variables 'xxxxyyy' \n" ); document.write( "
Algebra.Com's Answer #500769 by Edwin McCravy(20056)\"\" \"About 
You can put this solution on YOUR website!
\r\n" );
document.write( "I don't know C.  I program in LibertyBASIC. I copied and pasted my \r\n" );
document.write( "LibertyBASIC program below for the 35 distinguishable \r\n" );
document.write( "permutations of xxxxyyy.  I think you can translate it to C \r\n" );
document.write( "using my comment statements which begin with ' followed by 4 spaces.\r\n" );
document.write( "I copied and pasted my output below the program:\r\n" );
document.write( "-----------------------------------------------------\r\n" );
document.write( "'    start with xxxxxxx\r\n" );
document.write( "gosub 1\r\n" );
document.write( "'    choose leftmost position p to change an x to a y in\r\n" );
document.write( "for p=1 to 5\r\n" );
document.write( "'    choose a 2nd position q right of position p to change an x to y in\r\n" );
document.write( "for q=p+1 to 6:if q=p then 2\r\n" );
document.write( "'    choose a 3rd position r right of q to change an x to y in\r\n" );
document.write( "for r=q+1 to 7:if r=q or r=p then 3\r\n" );
document.write( "'    change the three x's to y's\r\n" );
document.write( "a$(p)=\"y\":a$(q)=\"y\":a$(r)=\"y\"\r\n" );
document.write( "'    increase the count and print it\r\n" );
document.write( "count=count+1:print count;\". \";\r\n" );
document.write( "'    print the first 6 letters in a row after the count\r\n" );
document.write( "for s=1 to 6: print a$(s);:next s\r\n" );
document.write( "'    print the 7th letter at the end the row\r\n" );
document.write( "print a$(7)\r\n" );
document.write( "'    change back to xxxxxxx\r\n" );
document.write( "gosub 1\r\n" );
document.write( "'    get the next value of r and loop back up\r\n" );
document.write( "3 next r\r\n" );
document.write( "'    get the next value of q and loop back up\r\n" );
document.write( "2 next q\r\n" );
document.write( "'    get the next value of p and loop back up\r\n" );
document.write( "next p\r\n" );
document.write( "'    we're done if we get here. So we end so we won't crash into the subroutine\r\n" );
document.write( "end\r\n" );
document.write( "'    subroutine to change all 7 to x's\r\n" );
document.write( "1 for n=1 to 7:a$(n)=\"x\":next n:return\r\n" );
document.write( "\r\n" );
document.write( "---------------------------------------------\r\n" );
document.write( "Here is the output for the above LIBERTY BASIC program\r\n" );
document.write( "1. yyyxxxx\r\n" );
document.write( "2. yyxyxxx\r\n" );
document.write( "3. yyxxyxx\r\n" );
document.write( "4. yyxxxyx\r\n" );
document.write( "5. yyxxxxy\r\n" );
document.write( "6. yxyyxxx\r\n" );
document.write( "7. yxyxyxx\r\n" );
document.write( "8. yxyxxyx\r\n" );
document.write( "9. yxyxxxy\r\n" );
document.write( "10. yxxyyxx\r\n" );
document.write( "11. yxxyxyx\r\n" );
document.write( "12. yxxyxxy\r\n" );
document.write( "13. yxxxyyx\r\n" );
document.write( "14. yxxxyxy\r\n" );
document.write( "15. yxxxxyy\r\n" );
document.write( "16. xyyyxxx\r\n" );
document.write( "17. xyyxyxx\r\n" );
document.write( "18. xyyxxyx\r\n" );
document.write( "19. xyyxxxy\r\n" );
document.write( "20. xyxyyxx\r\n" );
document.write( "21. xyxyxyx\r\n" );
document.write( "22. xyxyxxy\r\n" );
document.write( "23. xyxxyyx\r\n" );
document.write( "24. xyxxyxy\r\n" );
document.write( "25. xyxxxyy\r\n" );
document.write( "26. xxyyyxx\r\n" );
document.write( "27. xxyyxyx\r\n" );
document.write( "28. xxyyxxy\r\n" );
document.write( "29. xxyxyyx\r\n" );
document.write( "30. xxyxyxy\r\n" );
document.write( "31. xxyxxyy\r\n" );
document.write( "32. xxxyyyx\r\n" );
document.write( "33. xxxyyxy\r\n" );
document.write( "34. xxxyxyy\r\n" );
document.write( "35. xxxxyyy\r\n" );
document.write( "\r\n" );
document.write( "Edwin
\n" ); document.write( "
\n" );