SHARE
TWEET

Untitled

campos20 Jun 2nd, 2020 773 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. //
  5. // Autor Alexandre Campos
  6.  
  7. // Variavel global
  8. int numero = 5;
  9.  
  10. int funcao(){
  11.  
  12.     printf("Numero: %d\n", numero);
  13.  
  14.     return 0;
  15. }
  16.  
  17. int main()
  18. {
  19.     int numero = 3;
  20.  
  21.     { // Escopo local
  22.         int numero = 10;
  23.         printf("Numero: %d\n", numero);
  24.     }
  25.  
  26.     // Exibe o numero do escopo da funcao main
  27.     printf("Numero: %d\n", numero);
  28.  
  29.     // Chamada da funcao
  30.     funcao();
  31.  
  32.     return 0;
  33. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top