. . . I have made it to displaying as a character What am i suppose to do next . . .
I think the point of that exercise is to show that a variable can be displayed in a printf as a character, an integer or a double value.
Reference: K&R C, ANSI C, "The C Programming Language," p.244, Appendix B, Standard Library, Table B-1.
For example, let's say you've created a situation where the user has responded to your prompts, and now variable c is equal to "A".
That ascii character, as a character, is "A". As an integer, it will have a numerical value. This number value will probably be 65.
Reference: Ascii Table - ASCII character codes and html, octal, hex and decimal chart conversion
The ascii character "a", the lowercase value, has an integer value of 97. (See chart).
So, by answering those questions, you would probably be going through a pattern where you: have a character input, assigned to a variable, report that variable's value as a character in a printf, report that variable's value as an integer in a printf, then add the 32, report those values, showing that you can change the letter by changing the integer value.
Some key ideas to getting this done will include:
knowing the modulo, the "%d" for decimal or integer reporting;
knowing the modulo, the "%c" for character reporting;
knowing how to type some arithmetic into the code.
Take a look at this example, which applies different types of PrintF conversions to a variable, x.
Notice how the percent signs and letters after them specify what kind of reporting we want from that variable.
Code:
#include <stdio.h>
main ()
{
int x;
x = 65;
printf ("Printing the integer value of x: %d \n", x);
printf ("Printing the character value of x: %c \n", x);
x += 32;
printf ("Printing the integer value of x with 32 added: %d \n", x);
printf ("Printing the character value of x after adding 32: %c \n", x);
return 0;
}
I compiled and ran that program, and then I received this result:
Code:
Printing the integer value of x: 65
Printing the character value of x: A
Printing the integer value of x with 32 added: 97
Printing the character value of x after adding 32: a
This works because the value of a variable can be interpreted in a variety of ways. It can hold and use its value as it was declared; and, it can use more restrictive subsets of that kind of variable. That is, you can always limit more, but you can't easily and correctly expand beyond the initial declaration.
An int, integer variable, can hold integers. But a char, character variable, is the value of one letter only; so, an int can hold the value of a char; picking what types of variables to use is usually a lesson that comes a little later. It looks like this lesson is about printf; so, it may be more to your advantage to concentrate on the "%d" or "%c" aspects of using that printf statement.
So, maybe you can apply that example above to solving your project problem.
There are also some standard library "stdlib.h" utilities which do some number conversions. I don't know if those are applicable for your lesson. I think the whole thing can probably be done with variations of printf, as above. Like, when you get into averaging those doubles, I would expect to see an answer that involved declaring the variable as double, and then maybe reporting it as a float using a "%f" or something like it (e, f, g, etc.).