Answer Posted / kk
let the number be n
int bin(int n)
{
static int sum=0;
if(n>1)
{
rem=n%2;
sum = sum *10 +rem;
n=n/2;
bin(n);
}
else
{
sum=sum*10+1;
}
return sum;
}
| Is This Answer Correct ? | 7 Yes | 8 No |
Post New Answer View All Answers
Is null always defined as 0(zero)?
How can I list all of the predefined identifiers?
What are logical errors and how does it differ from syntax errors?
What is static and volatile in c?
Declare the structure which contains the following members and write in C list of all students who score more than 75 marks. Roll No, Name, Father Name, Age, City, Marks.
what is a NULL Pointer? Whether it is same as an uninitialized pointer?
what is associativity explain what is the precidence for * and & , * and ++ how the folloing declaration work 1) *&p; 2) *p++;
Why c is called free form language?
Why do we use namespace feature?
Devise a program that inputs a 3 digit number n and finds out whether the number is prime or not. Find out its factors.
What is double pointer in c?
What is the purpose of sprintf?
What is the difference between formatted&unformatted i/o functions?
What is page thrashing?
What’s the special use of UNIONS?