Binary to Base 10

0 J show · February 17, 2015
How do you guys suppose to go about this?

Post a Reply

Replies

Oldest  Newest  Rating
+1 Lazar Bulic · February 17, 2015
http://bit.ly/17OQbNW
0 J show · February 17, 2015
I wanted to write code on it.. I know how to do it by hand i'm just trying ti figure out how to write the code for it.
0 c student · February 17, 2015
if you can do it by hand in a systematic way, you can formulate an algorithm for it.  get your pseudo code correct and simply turn it into code.
0 J show · February 17, 2015
Alright i'll try! haha

I wrote the base 10 to binary code :

#include <stdio.h>
 
 
int main(void)
 
 
{
 
       int value, binary;
 
       printf("Enter base ten number you want converted to binary:");
       scanf("%d", &value);
 
       while(value>0){
 
              binary = value%2;
              value = value/2;
              printf("%d", binary);
 
       }
 
 
return 0;
}

Now i just have to figure out how to display it in reverse order. ha
0 Lazar Bulic · February 17, 2015
Make an array of ints and display it  in reverse order.
  • 1

C

107,042 followers
About

One of the most popular languages of all time.

Links
Moderators
Bucky Roberts Administrator