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
Stimulate calculator using Switch-case-default statement for two numbers
What is main () in c?
What is string concatenation in c?
How can I do graphics in c?
What are the 5 types of organizational structures?
What is a const pointer in c?
What is c basic?
What are structures and unions? State differencves between them.
How many identifiers are there in c?
Write a code to generate a series where the next element is the sum of last k terms.
Find duplicates in a file containing 6 digit number (like uid) in O (n) time.
what is diffrence between linear and binary search in array respect to operators?what kind of operator can be used in both seach methods?
How do you print only part of a string?
What are the different types of control structures?
How many loops are there in c?