#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2013
    Posts
    2
    Rep Power
    0

    Value convert in to Ascii Code


    hello
    i have made program in C language. in this program user can convert any value in Ascii code as well as user give ascii code program will convert in value but output is not showing correct value. whats the problem in this source code??? please check and resolve my issue.. please help meee....

    #include<stdio.h>
    #include<conio.h>

    void main()
    {
    char a;
    int b = (int) a;
    int x;
    char y = (char) x;
    clrscr();
    printf("\n Enter the Alphabetic Value: ");
    scanf("%c",a);
    printf("\n The Aaski Code of %c is %d",a,b);

    printf("\n\n Enter the Aaski Code: ");
    scanf("%d",x);
    printf("\n The Value of Aaski Code is %d is %c",x,y);
    getch();
    }
  2. #2
  3. Contributed User
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    Jun 2005
    Posts
    4,379
    Rep Power
    1871
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper

IMN logo majestic logo threadwatch logo seochat tools logo