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
How can you check to see whether a symbol is defined?
Why is C language being considered a middle level language?
Which is not valid in C a) class aClass{public:int x;}; b) /* A comment */ c) char x=12;
What is the advantage of a random access file?
What is "Duff's Device"?
Do you know the difference between malloc() and calloc() function?
What is a scope resolution operator in c?
Which is the best website to learn c programming?
How do you convert strings to numbers in C?
What is #error and use of it?
What is hash table in c?
how to find binary of number?
What are register variables in c?
swap 2 numbers without using third variable?
a function gets called when the function name is followed by a a) semicolon (;) b) period(.) c) ! d) none of the above