Advertisement
d3dx939dll

Aula41 - Casting

Jan 20th, 2021
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.43 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main(void){
  4.  
  5.     int x = 16;
  6.     int y = 3; 
  7.  
  8.     float resultado = (float) x / y;
  9.     char resultado2 = (char) x / y;
  10.     int resultado3 = (int) x / y;
  11.    
  12.     printf("Resultado (Char): %c\n", resultado2);
  13.     printf("Resultado (Float): %f\n", resultado);
  14.     printf("Resultado (int): %i\n", resultado3);
  15.     return 0;
  16. }
  17.  
  18. //Sobre
  19.  
  20. //Aula: Casting (#41)
  21. //Video: https://www.youtube.com/watch?v=jG_Pp_Cozwc
  22.  
  23. //Data: 21/01/2021
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement