A Binary no. is given, we hav to find it's decimal
equivalent.
Answer Posted / bunker
include<stdio.h>
include<conio.h>
void main()
{
int n,x,a,i;
printf("ENTER THE DECIMAL NO");
scanf("%d'&n);
for(i=2;i<=n;i++)
x=n%2;
a=x/2;
printf("binary %d",a);
getch();
}
Is This Answer Correct ? | 6 Yes | 24 No |
Post New Answer View All Answers
write a program that prompt the user to enter his height and weight,then calculate the body mass index and show the algorithm used
3. Program to find the Sum of give series. a. (1)+(1+2)+(1+2+3)+(1+2+3+4)+……………………………….. b. 1/1+1/9+1/25+1/49+……………...
Write a C/C++ program that connects to a MySQL server and displays the global TIMEZONE.
U hv to enter a range from a and b and search hw many no. of times a pattern n. occurs between the range a and b. Eg :i/p:enter range :0 100 Enter pattern: 13 o/p: the no. times 13 occurred betwwn 0 to 100:1 Eg :i/p:enter range :100 1000 Enter pattern: 13 o/p: the no. times 13 occurred betwwn 100 to 1000: (in this 13,113,131,132,133…139,213,313,…913 all these will be counted)
Teta-Omeg-Big-Oh Show that f(n) = n2 + 3n3 is ;(n3).
write a program to convert temperature from fa height into celcius and vise versa,use modular programming
create a stucture student containing field for roll no,class,year and marks.create 10 student annd store them in a file
What output does this program generate as shown? Why? class A { A() { cout << "A::A()" << endl; } ~A() { cout << "A::~A()" << endl; throw "A::exception"; } }; class B { B() { cout << "B::B()" << endl; throw "B::exception"; } ~B() { cout << "B::~B()"; } }; int main(int, char**) { try { cout << "Entering try...catch block" << endl; A objectA; B objectB; cout << "Exiting try...catch block" << endl; } catch (char* ex) { cout << ex << endl; } return 0; }
write a function that allocates memory for a single data type passed as a parameter.the function uses the new operator and return a pointer to the allocated memory.the function must catch and handle any exception during allocation
Write a (n) algorithm that sorts n distinct integers, ranging in size between 1 and kn inclusive, where k is a constant positive integer. (Hint: Use a kn-element array.)
Write a C/C++ program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the total number of disk writes by MySQL.
write a program to perform generic sort in arrays?
Code for Two Classes for Doing Gzip in Memory?
1+1/2!+1/3!+...+1/n!
write a program that reads a series of strings and prints only those strings begging with letter "b"