Advertisement
KDOXG

if-then-else

Dec 20th, 2018
443
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.29 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. void main(){
  4.     int i=0;
  5.     char c, k;
  6.     k = 'k';
  7.     c = k;
  8.     if (c == k)
  9.     {
  10.         printf("Isto executou porque o caractere de c é igual ao de k.\n");
  11.     }
  12.     if (i > 5)
  13.     {
  14.         i=5;
  15.     }
  16.     else
  17.     {
  18.         printf("\nIsto executou porque o valor de i não é maior que 5.");
  19.     }
  20.     return;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement