sir, ihave a doubt on converting a inputed decimel number to a octal number
will u help me?
you mean you want to print an octal representation of a decimal number?
Check out your language reference for itoa.
Here`s the code to convert a decimel number in any desired base
int d,b=1,r,a,q,c = 0,s;
cout<<"enter the no.:";
cout<<"\nenter base :";
q = d/b;
r = d%b;
d = q;
n[c] = 55 + r;
n[c] = 48 + r;
n[c] = '\0';
cout<<"\nthe no. in base "<<b<<" is : ";
for(int i = c-1;i>=0;i--)
don't give people complete programs, it stops them from thinking for themselves...
Or if you do include some subtle logic errors that they'll have to solve to make it work.
And if you do give sample code make it proper code.
void main() is an abomination, <iostream.h> etc. are deprecated
Unnecessary and a nonstandard function.
> n[c] = 55 + r;
> n[c] = 48 + r;