Character Example
#include <stdio.h>
main ( )
{
char ch;
printf (“Enter a character: “);
scanf (“%c”, &ch);
printf (“The value of %c is %d.\n”, ch, ch);
}
If the user entered an A the output would be
The value of A is 65.
Previous slide
Next slide
Back to first slide
View graphic version