d3dx939dll

Aula19 - Operador Ternário - ("?")

Dec 22nd, 2020 (edited)
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.37 KB | None | 0 0
  1. /*
  2. Aula: Comando "?"
  3. Data: 23/12/2020
  4. Link: https://www.youtube.com/watch?v=_LFw4H_Zfyc&t=65s
  5. Grupo: Heikoa
  6. */
  7. #include <stdio.h>
  8. int main()
  9. {
  10.     int num1 = 10;
  11.     int num2 = 20;
  12.  
  13.     int resposta;
  14.  
  15.     num1 < num2 ? printf("sim\n") : printf("nao\n");
  16.     num1 < num2 ? resposta = 10 : resposta  = -10;
  17.    
  18.     printf("%i\n", resposta);
  19.  
  20.     return 0;
  21. }
  22.  
Add Comment
Please, Sign In to add comment