hmm... that would be an awesome option, but no idea how to implement that...
Type: Posts; User: friedsandwich
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...
that is giving me the result of 0.000000 no matter what numbers i enter.
but % will ONLY give me the remainder, I am trying to input 2 numbers and display their quotient even when the result is not a whole number....
my code so far.....
#include <stdio.h>
#include <math.h>
int main(void)
{
having a problem with finding the quotient of two numbers.... a switch statement won't allow me to use a double so finding the quotient of 15/4 is coming up with the answer 3... how do i fix this...
Yeah i Think this could be a good project. I'm thinking operations of:
addition of x and y, subtraction of x and y, multiplication of x and y, division of x and y, absolute value of x, square root...
ha ha didn't read your post before i wrote my last one. That was the only idea i could come up with too. I am just hoping that it's not too limited by just using the <math.h> file and no coding of my...