# Thread: Noob .help

1. ## Noob .help

So basically i wanted to get into learning C programming, and i got the book C Programming second edition for the Absolute beginner i just started reading and doing the given challenges in the book until i got stumped on probably one of the easiest one. If you could help it'll be much apprieciated. basically the questions ask, Given a = 5, b = 1, x =10 ,and y =5, create a program that out puts the result of the formula f = (a - b)*(x - y) using a single printf() function? i don't expect anyone to write the code even tho i'm sure its easy i just need some points up to this point i have most basics down. this being simple math is easy to do with just a pen and paper but on the computer its different. please help

2. A "challenge" is something you take on when you have some proficiency at something. Obviously, you still haven't gotten down the basics yet, so I'd suggest doing that before you proceed any further.

3. Originally Posted by Sebastiani
A "challenge" is something you take on when you have some proficiency at something. Obviously, you still haven't gotten down the basics yet, so I'd suggest doing that before you proceed any further.
What Sebastiani is trying to say here is that he would like to see some code you have tried please so we can understand better what is going on in your head.

4. Originally Posted by IG SIV0IVIAIV
this being simple math is easy to do with just a pen and paper but on the computer its different. please help
And of course this sentence here is amazingly false. The math on the computer, funnily enough, is exactly the same as the math you do on paper.

5. Something like this?
Code:
`printf("f = %d\n", (a - b) * (x - y));`

6. You could make it interesting and try to solve for an unknown. But be that as it may, why not just simply make an explicit function?

Code:
```double f(double x)
{
// do stuff here.
}```
Then you can simply call f(x) as you please.

7. I'm sorry for answering a week old post....

But I'm sure if you re-read the chapter where the challenge was in, you'll find the answer you are looking for.....

Also, don't forget to go back and study how int is used....

Here's a bit of a hint: the code will have 10 lines (without white spaces, but with the last newline)

Popular pages Recent additions