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
Which is best linux os?
What are comments and how do you insert it in a C program?
What is pass by reference in c?
Explain what does a function declared as pascal do differently?
What is a method in c?
Explain About fork()?
What are the different types of control structures in programming?
Why does notstrcat(string, "!");Work?
How do you define a string?
What is getch c?
console I/O functions means a) the I/O operations done on disk b) the I/O operations done in all parts c) the input given through keyboard is displayed VDU screen d) none of the above
What are # preprocessor operator in c?
What is the difference between a function and a method in c?
What are the key features in c programming language?
Can we change the value of constant variable in c?