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
Can a function argument have default value?
What are the advantages of the functions?
What is "Hungarian Notation"?
what do the 'c' and 'v' in argc and argv stand for?
Can an array be an Ivalue?
What is a ternary operator in c?
GIven a sequence of characters. How will you convert the lower case characters to upper case characters. ( Try using bit vector - sol given in the C lib -> typec.h)
Write a program to check whether a number is prime or not using c?
Define circular linked list.
What does %p mean c?
What is the difference between variable declaration and variable definition in c?
How do you define CONSTANT in C?
show how link list can be used to repersent the following polynomial i) 5x+2
Explain the difference between structs and unions in c?
Why header file is used in c?