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 build process in c?
Explain what header files do I need in order to define the standard library functions I use?
Where does the name "C" come from, anyway?
What is the difference between #include
Explain what are the different file extensions involved when programming in c?
Is it possible to initialize a variable at the time it was declared?
Can true be a variable name in c?
Why is python slower than c?
What does %c do in c?
Explain what is a 'null pointer assignment' error? Explain what are bus errors, memory faults, and core dumps?
What is structure in c explain with example?
Why we use conio h in c?
Explain what is the most efficient way to store flag values?
What is the purpose of 'register' keyword in c language?
What is || operator and how does it function in a program?