I have 3 digits (1,4,6) and I want to create a number with 2 digits from my digits like 11,14,16,41,44,46,61,64,66.
What command should I use in c++ ?
I have 3 digits (1,4,6) and I want to create a number with 2 digits from my digits like 11,14,16,41,44,46,61,64,66.
What command should I use in c++ ?
There is no single command for this. You have to write the code yourself, eg:
int arr[] = {1, 4, 6};
for(int a : arr) {
for(int b : arr) {
cout << a << b << endl;
}
}
Alternatively:
int arr[] = {1, 4, 6};
for(int a : arr) {
for(int b : arr) {
int value = (a * 10) + b;
cout << value << endl;
}
}