Mega Code Archive

 
Categories / C Tutorial / Data Type
 

Characters and numbers

#include <stdio.h> int main(void) {   char first = 'T';   char second = 20;   printf("\nThe first example as a letter looks like this - %c", first);   printf("\nThe first example as a number looks like this - %d", first);   printf("\nThe second example as a letter looks like this - %c", second);   printf("\nThe second example as a number looks like this - %d\n", second);   return 0; } The first example as a letter looks like this - T The first example as a number looks like this - 84 The second example as a letter looks like this -  The second example as a number looks like this - 20