Hii everyone:)
I have written this code to do conversion between decimal to any base between 2 and 26....
But this is not working properly
ca any one help me:confused
#include<iostream.h>
#include<conio.h>
void conversion(int no,int base)
{
int arr[10]={0};
int i=0;
while(no>0)
{
arr[i]=no%base;
i++;
no=no/base;
}
for(int j=i;j>=0;j--)
cout<<arr[j];
}
void conversionGreater(int no,int base)
{
int arr[20]={0};
int i=0,j=0;
char a='A';
while(no>0)
{
arr[i]=no%base;
i++;
no=no/base;
if(no>=10)
{
j=no%base;
for(int k=0;k<j;k++)
arr[i]=a+k;
i++;
no=no/base;
}
}
for(int l=i;l>=0;l--)
cout<<arr[l];
}
void main()
{
clrscr();
int base=16;
int no=2600;
if(base >=2 && base<=9)
conversion(no,base);
else if(base >=11 && base<=26)
conversionGreater(no,base);
getch();
}