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
Create a registration form application by taking the details like username, address, phone number, email with password and confirm password (should be same as password).Ensure that the password is of 8 characters with only numbers and alphabets. Take such details for 3 users and display the details. While taking input password must appear as “****”.
What are the different types of data structures in c?
How many levels of indirection in pointers can you have in a single declaration?
any "C" function by default returns an a) int value b) float value c) char value d) a & b
Do you know the purpose of 'register' keyword?
Why is this loop always executing once?
what is the different bitween abap and abap-hr?
Write a C program to help a HiFi’s Restaurant automate its breakfast billing system. Your assignment should implement the following items: a. Show the customer the different breakfast items offered by the HiFi’s Restaurant. b. Allow the customer to select more than one item from the menu. c. Calculate and print the bill to the customer. d. Produce a report to present your complete program and show more sample output. Assume that the HiFi’s Restaurant offers the following breakfast menu: Plain Egg $2.50 Bacon and Egg $3.45 Muffin $2.20 French Toast $2.95 Fruit Basket $3.45 Cereal $0.70 Coffee $1.50 Tea $1.80
What are the features of c language?
What is a pragma?
Array is an lvalue or not?
What are different types of operators?
What is the c value paradox and how is it explained?
How do you do dynamic memory allocation in C applications?
How to set file pointer to beginning c?