Advertisement
lucontre

lab 4 problema 3

May 10th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.50 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. void ascii(char); //declaro prototipo de funcion
  5.  
  6. int main()
  7. {
  8.  
  9.     char c;
  10.     printf("ingrese caracter\n");
  11.     scanf("%c",&c);
  12.     ascii(c);
  13. return 0;
  14. }
  15.  
  16. void ascii(char c){ // HAaaaaORA declaro la funcion
  17.  printf("El valor ASCII sin signo es : %d\n",(c<0)?(256+c):c);
  18.  printf("El valor ASCII con signo es : %d\n",c);
  19.  printf("El valor ASCII octal es : %o\n",(c<0)?(256+c):c);
  20.  printf("El valor ASCII hexadecimal es : %x\n",(c<0)?(256+c):c);
  21.  
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement