Characters and numbers: output : Char « Data Type « C / ANSI-C






Characters and numbers: output

Characters and numbers: output
/*Characters and numbers */
#include <stdio.h>

void main()
{
  char first = 'Y';
  char second = 40;

  printf("\n first as a letter looks like this - %c", first);
  printf("\n first as a number looks like this - %d", first);
  printf("\n second as a letter looks like this - %c", second);
  printf("\n second as a number looks like this - %d\n", second);
}



           
       








Related examples in the same category

1.Encrypting a password
2.Char: to upper case
3.Use data type: char
4.Char: Converting uppercase to lowercaseChar: Converting uppercase to lowercase
5.Char to lower case
6.maximum and minimum value of char
7.Get char and change it to float
8.Double check before erasing
9.Assing int value to a char type variable
10.Output char to the console
11.For loop with char as the loop condition