halo /g/
I did every question except #3 pls halp
Uh... C = (F - 32)/1.8; or C = (F - 32)/1.8f;
What's hard about that?
C = (F. - 32) / 1.8
The . after the F casts it to a float, which is required here.
Didn't they cover casting yet?
>>53389763
Casting it to float is unnecessary. 1.8 is already double and 1.8f is a float literal. Given only int/int division truncates, (F - 32)/1.8 is perfectly valid.
>>53389798
I was hoping to be first and have him submit it as the answer and get it wrong so that he decides to not make these threads in the future
>>53389838
Sorry, I was foolish.
>>53389705
Disregard what I said until now. The answer is (float) (F. - 32.000f) / (double) 1.8.
>>53389980
modern universities everybody
>>53390100
Honestly, go somewhere else.
>>53390100
It's not like a professor wouldn't give you points back for that.
>>53390111
>mug /g/
>>53390141
I'm not trying to tell him to leave /g/ or this thread, but the university that can't into parsing decent lines of code.
Just get rid if the whitespace first, it's not a problem.
>>53390141
I think he was talking about the uni.
>>53390165
my bad then
>>53390141
He was saying find a new university so you actually learn something, but you might as well stay seeing as it fits your level of intellect.
>>53390217
>there's only one correct way of interpretation
also
>implying in going though uni for the educational value
>>53389705
it's literally covered in K&R
it's the first fucking program in the book
How is that arithmetic expression of equality in #2 expressed by an assignment statement?
Shouldn't it bez == (x + y) * w
>>53391248
it doesn't say it's testing equality
I'd assume it's meant to be assignment
>>53391299
That doesn't make sense mathematically though
>>53391248
I think it would be called a statement rather than an arithmetic expression, if the teacher wanted the students to use logical operators.
"the statement 'z = x + y' can be written in C as...?", for example.
In Algebra, "z = x + y" just states a relationship between variables/values, and since that can't be applied in real time in C or most programming languages, you have the student assign the value x + y to the variable z.
I'm probably looking at it the wrong way, but there's no need to overthink this since it's an introductory exercise.
>>53391203
OP's only source for help is /g/. You think he'd even ask his professor? Wait until the next thread where he says "halo /g/ my teacher said main should return 0, but what about EXIT_SUCCESS?".
>>53390100
Bring it up with your department chair. That's ridiculous. They need to get a refund if they paid for that website