Hi everybody, I'm new here.
I've just begun a course on C programming. We have just done for/while loops and if statements and haven't even gotten into functions yet! So please be gentle!
There is an exercise that has been doing my head in. It says:
Write a program that takes any number of integer inputs between 1 and 70 and plots a simple graph.
eg. it would look like:
> ./grapher
Enter numbers: 25 20 3 12 45
25 | *************************
20 | ********************
3 | ***
12 | ************
45 | *********************************************
In the chapter this exercise is in, we learned about the getchar() and putchar() functions and we have also learned earlier about scanf and printf.
I just need some hints on how to start with this. A great hint would be whether I should be tackling the inputs with getchar or with scanf. Then at least I can focus on one or other, as I have been trying both and have gotten nowhere.
Am I right in saying it is important to preserve the value of the 2-digit numbers, eg. if "20" is input then it is useless if it gets converted into ASCII as "2" and "0" because we need to use the value "20" to print 20 asterixes (somehow)???
Thankyou kindly for your help!