Advertisement
Farjana_akter

Untitled

Jun 29th, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. char x[5];
  4. void combination(int pos,char letter)
  5. {
  6. x[pos]=letter;
  7. // cout<<x[pos]<<endl;
  8. if(pos>=3)
  9. {
  10. for(int i=1;i<=3;i++)
  11. cout<<x[i]<<" ";
  12. cout<<endl;
  13. return;
  14. }
  15. combination(pos+1,'a');
  16. combination(pos+1,'b');
  17. combination(pos+1,'c');
  18. }
  19. int main()
  20. {
  21. combination(0,'a');
  22. return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement