C++ program to print all possible combinations from the given alphabets
C++ program to print all possible combinations from the given alphabets
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
#include<iostream> #include<conio.h> using namespace std; int main() { char t4tutorials[3]; cout<<"Please Enter 3 alphabets :"<<endl; cin>>t4tutorials[0]>>t4tutorials[1]>>t4tutorials[2]; for (int i=0;i<3;i++) { for(int j=0;j<3;j++) { for (int k=0;k<3;k++) { if (i!=j&&i!=k&&j!=k) cout<<endl<<endl<<t4tutorials[i]<<t4tutorials[j]<<t4tutorials[k]; } } } } |
Output
C++ program to print all possible combinations from the given Digits
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
#include<iostream>
#include<conio.h> using namespace std; int main() { char t4tutorials[3]; cout<<"Please Enter 3 digits :"<<endl; cin>>t4tutorials[0]>>t4tutorials[1]>>t4tutorials[2]; for (int i=0;i<3;i++) { for(int j=0;j<3;j++) { for (int k=0;k<3;k++) { if (i!=j&&i!=k&&j!=k) cout<<endl<<endl<<t4tutorials[i]<<t4tutorials[j]<<t4tutorials[k]; } } } } |
Output