Answer Posted / kamalb008
#include<stdio.h>
main()
{
int a,i,b,n;/*i have taken arbitary base u can enter the
base what ever u need*/
printf("enter the number and the base u want to conv resp");
scanf("%d%d",&a,&n);
i=1;
while(i<=20)
{
if(a<n)
break;
b=a%n;
a=a/n;
printf("\nLSB%d of the converted number is %d",i,b);
i++;
}
printf("\nMSB of the conv is %d",a);
}
| Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
What is difference between main and void main?
What is auto keyword in c?
How does free() know explain how much memory to release?
What are the advantages of c preprocessor?
How can I trap or ignore keyboard interrupts like control-c?
A banker has a seif with a cipher. Not to forget the cipher, he wants to write it coded as following: each digit to be replaced with the difference of 9 with the current digit. The banker chose a cipher. Decipher it knowing the cipher starts with a digit different than 9. I need to write a program that takes the cipher from the keyboard and prints the new cipher. I thought of the following: Take the input from the keyboard and put it into a string or an array. Go through the object with a for and for each digit other than the first, substract it from 9 and add it to another variable. Print the new variable. Theoretically I thought of it but I don't know much C. Could you give me any kind of hint, whether I am on the right track or not?
What does char * * argv mean in c?
How do I get an accurate error status return from system on ms-dos?
What is the difference between a string copy (strcpy) and a memory copy (memcpy)? When should each be used?
Difference between strcpy() and memcpy() function?
Why is it that not all header files are declared in every C program?
What are actual arguments?
What are the types of variables in c?
Difference between goto, long jmp() and setjmp()?
Who invented bcpl language?