I have a program assignment in my C and Unix class that allows the user to enter two numbers in binary seperated by (*,+,-,or /). It then has to produce an answer and loop back to the beginning. It also has to have an option to exit. Can anyone help?
khsoccer
0
Newbie Poster
Recommended Answers
Jump to PostSure, when you show your code and tell about your problems. Do not forget to push the CODE before pasting your code. Happy coding!
Jump to PostStart by adding print statements to be sure you are reading the input properly.
Program one step at a time.
First input. Make sure it works.
Next internal representation of the values -- print them. Make sure they are correct.
Next...
Jump to PostTo begin with, you seem to be having trouble understanding the structure of functions such as
main()
. In the function implementation, you do not put a semi-colon at the end of the function header - you only do that with function prototypes, which you probably haven't covered yet. …
Jump to PostYou also can not assign value of exit at line 16 of edited code of previous poster to value of choice as it is undeclared and uninitialized. It should be compatible integer type variable for the assignment to succeed and to have nonzero value for if test to succeed.
Jump to PostI am still a beginner in the c language, so i am still working on the correct format of my programs.
Fair enough. We were all beginners, once.
I still have to work out the format of this program, but i am having trouble finding how to code for the …
All 17 Replies
TrustyTony
888
pyMod
Team Colleague
Featured Poster
asitmahato
-4
Newbie Poster
khsoccer
0
Newbie Poster
cse.avinash
-1
Junior Poster
WaltP
2,905
Posting Sage w/ dash of thyme
Team Colleague
Schol-R-LEA
1,446
Commie Mutant Traitor
Featured Poster
TrustyTony
888
pyMod
Team Colleague
Featured Poster
khsoccer
0
Newbie Poster
Schol-R-LEA
1,446
Commie Mutant Traitor
Featured Poster
TrustyTony
888
pyMod
Team Colleague
Featured Poster
khsoccer
0
Newbie Poster
Schol-R-LEA
1,446
Commie Mutant Traitor
Featured Poster
khsoccer
0
Newbie Poster
Schol-R-LEA
1,446
Commie Mutant Traitor
Featured Poster
WaltP
2,905
Posting Sage w/ dash of thyme
Team Colleague
Schol-R-LEA
1,446
Commie Mutant Traitor
Featured Poster
Schol-R-LEA
1,446
Commie Mutant Traitor
Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.