Saturday, April 27, 2013

ASCII: Find a ASCII value of a character in C

Write a program to find  a ASCII value of a character in C




#include<stdio.h>
#include<conio.h>
main()
{
int n;
char c;
printf("Enter any character: ");
scanf("%c",&c);
printf("\n the ascci value of character is:%d",c);
return 0;
}


6 comments:

  1. #include
    int main()
    {
    int i;
    i=0;
    do
    {
    printf("%d %c \n",i,i);
    i++;
    }
    while(i<=255);
    }

    ReplyDelete
  2. Dajen, yours program will print all characters ASCII value but not a single character that I want

    ReplyDelete
  3. I think you are new comer in blogs world. and not perfect for any blog

    ReplyDelete
  4. What do you mean? Do you know program ? Or copy past programmer ??

    ReplyDelete
  5. void main()
    {
    int e;
    char ch;
    clrscr();
    printf("\n Enter a character : ");
    scanf("%c",ch);
    e=ch;
    printf("\n The ASCII value of the character is : %d",e);
    getch();
    }

    ReplyDelete
  6. Flo mi program dat I comnt. I think u sud lrn mor mor & mor program

    ReplyDelete