Tuesday, 29 September 2015

C Program to diplay ASCII value of Character data type



/*C Program to diplay ASCII value of Character data type*/
#include<stdio.h>
main()
{
      char gender='m',ans='M',num='2',sp_char=' ';
      printf("\n The character stored in gender is %c and its ASCII value is %d",gender,gender);
      printf("\n The character stored in gender is %c and its ASCII value is %d",ans,ans);
      printf("\n The character stored in gender is %c and its ASCII value is %d",num,num);
      printf("\n The character stored in gender is %c and its ASCII value is %d",sp_char,sp_char);
}

No comments:

Post a Comment