1. ## A question about convert()

Hello

I have to write a program that uses a function called convert(), which prompts hte user for an amount in dollars and returns this value converted into pounds. Exchange rate of 2 dollars per pound.
This is a exercise from Herbert Shildts book Teach Yourself C.

I checked the net to find out what and how this function works but I didnt find anything.

So far I have written:

Code:
```#include <stdio.h>
#include <math.h>

void convert(void);

int main(void)
{
int dollar;

printf("Enter the value in dollars: ");
scanf("%d" &dollar);
convert();

printf("This equals to the following amount of pounds");
return 0;
}

void convert()
{

}``` 2. I have to write a program that uses a function called convert(), which prompts hte user for an amount in dollars and returns this value converted into pounds.
So do you know how to do the first part (prompt the user)?

What about the second part (return a value)?

You really should also start looking for a better book. Your current book is probably based on one of the worst books on programming (in any computer language) ever written. By the way I say probably because it could be the worst of the worst, the first printing. Avoid all books by that author and find a different book. 3. Originally Posted by GodEmperor Hello

I have to write a program that uses a function called convert(), which prompts hte user for an amount in dollars and returns this value converted into pounds. Exchange rate of 2 dollars per pound.
This is a exercise from Herbert Shildts book Teach Yourself C.

I checked the net to find out what and how this function works but I didnt find anything.
Have you studied the chapter on functions, as well as all the chapters that came before? If so you should have all the information you need to do the exercise.

If you need a better book on C, can I recommend one of three different books?

C Programming, A Modern Approach
Author: K. N. King

C Primer Plus, 6th Edition
Stephen Prata

C How to Program, 8/e
Deitel & Deitel

Choose one of the above, study it cover to cover, and do all the exercises at the end of each chapter. 4. So do you know how to do the first part (prompt the user)?
scanf asks you after you run the program for a value and you type it.

What about the second part (return a value)?
I don't know the answer for this question.

By the way I say probably because it could be the worst of the worst, the first printing. Avoid all books by that author and find a different book.
It is actually the third edition of Teach Yourself C by Schildt. I'm just curious why does he have such a negative opinion. 5. Originally Posted by rstanley Have you studied the chapter on functions, as well as all the chapters that came before? If so you should have all the information you need to do the exercise.

If you need a better book on C, can I recommend one of three different books?

C Programming, A Modern Approach
Author: K. N. King

C Primer Plus, 6th Edition
Stephen Prata

C How to Program, 8/e
Deitel & Deitel

Choose one of the above, study it cover to cover, and do all the exercises at the end of each chapter.
I did all the exercises. Popular pages Recent additions amount, convert, convert function, dollars, program 