#What did I do wrong here and how can I fix the problem?

23 messages · Page 1 of 1 (latest)

modest cipherBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question run !howto ask.

twin mural
#

#include <stdio.h>

int main(void)
{
float area = 0.0f;
float length = 0.0f;

printf("What is the ellipse's area? ");
scanf("%f", &area);

printf("What is the length of one of the ellipse's axes? ");
scanf("%f", &length);

const float PI = 3.14159f;
float area_2 = PI * area * length;

printf("\nThe ellipse's other axis is: %.2f", area_2);

return 0;

}

Can someone tell me what I did wrong and how can I fix the problem?

mortal rampart
#

You're misreading the instructions.

#c-help-text message

exotic vapor
twin mural
exotic vapor
#

look down

#

look two lines below where it mentions pi

#

the wording of this problem is kinda problematic though

#

it asks for the other axis without specifying if it's the semi major axis or semi minor axis that it wants you to find

#

but with the equation they provided it's clear they want the semi major axis bing_shrug

#

actually it wouldn't matter but stillwithered

twin mural
#

#include <stdio.h>

int main(void)
{
float area = 0.0f;
float length = 0.0f;

printf("What is the ellipse's area\? ");
scanf("%f", &area);

printf("What is the length of one of the ellipse's axes\? ");
scanf("%f", &length);

const float PI = 3.14159f;
float a = area / (PI * length);

printf("\nThe ellipse's other axis is: %.2f", a);

return 0;

}

mortal rampart
exotic vapor
#

problematic at first glance*

twin mural
mortal rampart
#

So read it again

twin mural
mortal rampart
twin mural