how to write a prog in c to convert decimal number into
binary by using recursen function,
Answer Posted / madhavi
void decitobin(int n);
main()
{
int n;
printf("Enter an integer:");
scanf("%d",&n);
decitobin(n);
}
void decitobin(int n)
{
if(n>0)
{
decitobin(n/2);
printf("%d",n%2);
}
}
Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
What is the function of this pointer?
What does c in a circle mean?
How can I write data files which can be read on other machines with different word size, byte order, or floating point formats?
Why is it that not all header files are declared in every C program?
What is the size of enum in c?
What is the difference between declaring a variable and defining a variable?
What is function prototype in c language?
Are there constructors in c?
How is = symbol different from == symbol in c programming?
What does it mean when a pointer is used in an if statement?
How is a pointer variable declared?
What is the difference between volatile and const volatile?
Can you explain the four storage classes in C?
Why we use void main in c?
What is bash c?