here is my code, it allows an equation such as 5+(6-2)*2^3/4-10 to be solved using order of operations, but i heard that the fflush(stdin) function is incorrect to use. what should i be using...
Type: Posts; User: friedsandwich
here is my code, it allows an equation such as 5+(6-2)*2^3/4-10 to be solved using order of operations, but i heard that the fflush(stdin) function is incorrect to use. what should i be using...
Thank you for this comment, It helped me understand the real problem. I should be addressing this problem in my other post.
so what? i created a new code entirely to do that standard arithmetic equation and then tried to combine the two codes together without rewriting the entire code. if you arent helping and just...
take a look at my pastebin, it has a lot of extra functions that i did not paste onto this page, none of that is the problem, the only problem i am having is with my case statements not going back to...
it's really long i dont know for sure where its happening that's why i did a pastebin
do
{
printf("\nMichael's Calculator\n");
printf("\nChoose what calculation to perform\n");...
[C] #include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> - Pastebin.com
i dont know what's going on here. if I perform "choice" 1 first at least once, my program and menu...
hmm... that would be an awesome option, but no idea how to implement that...
this worked. :)
I am using Pelles C, I use this because this is the one we use at school.
That is what i've been saying.... i have the math.h header file included and the M_PI does not work... i cant explain this any more clear than i already have.
"error #2048: Undeclared identifier...
is it really that hard just to scroll through my code and see what im talking about?
case 5:
{
printf("\nArea Of A Circle\n");
printf("\nEnter the...
I get the error if i delete #define PI 3.14159 and then anywhere i have used my defined PI i replace with M_PI it tells me that M_PI has not been defined as a variable. (obviously in my area...
there is no error and my areas work fine. the only problem was when i tried to use the M_PI in place of my defined PI value, which isn't a big deal anyways. my teacher wants me to write my own code...
oh geez, sorry that my formatting was messed up while pulling this code of my gmail drive.....
#include <stdio.h>
#include <math.h>
#define PI 3.14159
int main(void)
{
double sum,...
sure thing
#include <stdio.h>
#include <math.h>
#define PI 3.14159
int main(void)
{
double sum, first_Num, sec_Num, third_Num,
diff, product, quotient, srt, area, rad1, rad2, base, height;...
I have the math.h included......?
I use pelles because thats what we use at school. Wouldn't mind getting familiarized with another compiler though. Thanks for the suggestion ill try it out
Pelles c
didnt know about that. good idea!
hmmm my compiler isnt allowing M_PI as a constant?
yeah that's what i don't like about my code. the fact that you can only do 1 operation kinda makes it less useful if i have an equation to solve. the best part of my code, imo, is the formulas for...
I'm thinking of adding volume formulas too. maybe a way to find the factors of a number but i'm not sure yet how to do that...
here is my code any suggestions on what i should add?
all input is much appreciated!!
#include <stdio.h>
#include <math.h>
#define PI 3.14159
HA HA HA oh man i feel stupid. yeah i forgot the damn ampersand. the compiler wasn't giving me any errors that's why i was so confused! thanks for correcting my stupidity!
I found the problem, had to declare all my variables as doubles instead of int except for choice. now I'm having problems inside my 8th case statement which opens a new menu of different shapes to...
yeah we learned about pointers this past week... how would i implement them in this situation?
since a switch statement doesnt allow the use of double do i need to change the whole code to nested if...