design a binary calculater which only adds two numbers in binary form.the program asks two binary, number from the user and the program displays the sum also in a base two number.
Can any programmer help me writing these program in c language?
here...I'll tell you what to write and you write it...
/* outline the program */
// void main()...etc..
/* define your variables */
/* you'll need a pair of char pointers */
/* and some numbers to hold converted values */
/* input the first binary as a string */
/* input the second binary as a string */
/* convert them to decimal */
/* add them */
/* fprintf them */
/* end program */
that's all.
I write all my programs in commented logic first then fill in the blanks so that it does what I meant. When I'm done, the program follows the flow and is already commented for the next person to follow.
Reply:I believe there is a printf format specification for printing a value in binary.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment