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
Why n++ execute faster than n+1 ?
Explain how are 16- and 32-bit numbers stored?
Why do we use pointer to pointer in c?
which is an algorithm for sorting in a growing Lexicographic order
What is define c?
What is 2c dna?
Explain what is wrong in this statement?
ATM machine and railway reservation class/object diagram
The postoder traversal is 7,14,3,55,22,5,17 Then ur Inorder traversal is??? please help me on this
What is modeling?
What is the difference between procedural and functional programming?
Explain how can type-insensitive macros be created?
What language is windows 1.0 written?
Can you think of a logic behind the game minesweeper.
#include main() { enum _tag{ left=10, right, front=100, back}; printf("left is %d, right is %d, front is %d, back is %d",left,right,front,back); }