Without further ado, just upload the code
#include<> #include<> #include<iostream> using namespace std; int main() { //Convert decimal to several binary systems>2,<16 = int num; int n;// Between 2-16 int a; int i=0; cin>>num>>n; int s[100]; if(n>=2&&n<<16) { while(num!=0) { a=num%n; num=num/n; i++; s[i]=a; } for(int j=i;j>=1;j--) { if(s[j]>=10) { cout<<s[j]+55; } else{ cout<<s[j]; } } } else{ cout<<"error"<<endl; } }
The above example of converting c++ decimal to any 2-16-digit number is all the content I share with you. I hope you can give you a reference and I hope you can support me more.