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 are compound statements?
What are pragmas and what are they good for?
What does s c mean in text?
What is void main () in c?
What is typedef example?
What are disadvantages of C language.
why return type of main is not necessary in linux
How can my program discover the complete pathname to the executable from which it was invoked?
Without Computer networks, Computers will be half the use. Comment.
7-Given an index k, return the kth row of the Pascal's triangle. For example, when k = 3, the row is [1,3,3,1]. For reference look at the following standard pascal’s triangle.
Why n++ execute faster than n+1 ?
What does c mean before a date?
How many levels deep can include files be nested?
What is context in c?
What is the difference between a free-standing and a hosted environment?