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 creates a sequenced array of numbers starting with 1 and alternately add 1 and then 2 to create the text number in the series , as shown below. 1,33,4,6,7,9,............147,148,150 Then , using a binary search , searches the array 100 times using randomly generated targets in the range of 1 to 150
Create a program to read two random data set in two files named data1.txt and data2.txt manifold contains integer numbers, whereas data2.txt file contains the float type numbers. Simpanlahmasing each into 2 pieces of data that is an array of type integer array and an array of type float, then calculate the average numbers in the second 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.
how to diplay a external image of output on winxp by using c & c++,
write a program that prompt the user to enter his height and weight,then calculate the body mass index and show the algorithm used
can you please write a program for deadlock that can detect deadlock and to prevent deadlock.
How can I Draw an ellipse in 3d space and color it by using graph3d?
Definition of priority queue was given. We have to implement the priority queue using array of pointers with the priorities given in the range 1..n. The array could be accessed using the variable top. The list corresponding to the array elements contains the items having the priority as the array index. Adding an item would require changing the value of top if it has higher priority than top. Extracting an item would require deleting the first element from the corresponding queue. The following class was given: class PriorityQueue { int *Data[100]; int top; public: void put(int item, int priority); // inserts the item with the given priority. int get(int priority); // extract the element with the given priority. int count(); // returns the total elements in the priority queue. int isEmpty(); // check whether the priority queue is empty or not. }; We had to implement all these class functions.
Code for Small C++ Class to Transform Any Static Control into a Hyperlink Control?
i don't know about working of nested for loop can any one help me
how to take time as input in the format (12:02:13) from user so that controls remains between these columns?
Code for Method of Handling Factorials of Any Size?
Code for Two Classes for Doing Gzip in Memory?
write a program that reverses the input number of n.Formulate an equation to come up with the answer.
solve the problem in the programming language C++"if a five digit number is input through the keyboard.Write a program to calculate the sum of its digits(hint: use the modulus operator)