fork download
  1. #include <stdio.h>
  2. int main(void) {
  3. char a;
  4. int x;
  5. printf("Enter character whose ascii value has to be found : ");
  6. scanf("%c",&a);
  7. printf("\n");
  8. x = a;
  9. printf("%d",x);
  10. return 0;
  11. }
  12.  
Success #stdin #stdout 0s 9424KB
stdin
z
stdout
Enter character whose ascii value has to be found : 
122