Any tips on starting a complex number calculator program?
jcr1
0
Newbie Poster
Recommended Answers
Jump to PostHello,
It might help to know what type of calculator program you are looking for. You might want to structure it so that the user has to input a function...
Welcome to the Calculator Program. Would you like to Add, Subtract, Divide, or Multiply (A,S,D,M)? You …
Jump to Post>according to my notes its right
And your notes have to be correct? Nope, sorry.>void main()
int main ( void )>int enter_operator;
char enter_operator;>scanf ("%d",&enter_operator);
scanf ("%c",&enter_operator);>if (enter_operator = +);
if (enter_operator == '+')>if (enter_operator = -)
else if (enter_operator …
Jump to Post>That,s no good either
Then you're doing it wrong.>it's given me more errors
Please start giving us workable information instead of complaining about your mythical non-working code. Your idiocy isn't entertaining anymore. More specifically, post the errors you get, and the code that causes them.
Jump to PostI assume #include <stdio.h>
int main (void) { int a_real,a_imaginary,j; int b_real,b_imaginary; int complex_number; char enter_operator; printf ("a real = "); scanf ("%d",&a_real); printf ("a imaginary = "); scanf ("%d",&a_imaginary); printf ("b real = "); scanf ("%d",&b_real); printf ("b imaginary = "); scanf ("%d",&b_imaginary); printf ("Enter operator …
Jump to Postdon't start a new thread when dealing with your old problem...
http://www.daniweb.com/techtalkforums/thread13701.html
and use code tags and hopefully indentation to make your code somewhat readable.
Have you tested what the value of your "enter_operator" actually is after the input?
Should it even go into one of your …
All 17 Replies
jcr1
0
Newbie Poster
Dave Sinkula
commented:
Use code tags. And don't use void main().
+0
kc0arf
68
Posting Virtuoso
Team Colleague
jcr1
0
Newbie Poster
jcr1
0
Newbie Poster
Narue
5,707
Bad Cop
Team Colleague
jcr1
0
Newbie Poster
Narue
5,707
Bad Cop
Team Colleague
jcr1
0
Newbie Poster
Dave Sinkula
commented:
Use code tags.
+0
frrossk
2
Posting Whiz in Training
jcr1
0
Newbie Poster
jcr1
0
Newbie Poster
jwenting
1,889
duckman
Team Colleague
jcr1
0
Newbie Poster
jwenting
1,889
duckman
Team Colleague
jcr1
0
Newbie Poster
jcr1
0
Newbie Poster
alc6379
120
Cookie... That's it
Team Colleague
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.