Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /******************************************************************************
- Online C Compiler.
- Code, Compile, Run and Debug C program online.
- Write your code in this editor and press "Run" button to compile and execute it.
- *******************************************************************************/
- #include <stdio.h>
- int a = 20;
- void functie(){
- printf("Variabila globala: %d\n", a);
- }
- int main()
- {
- //scope 1
- int a = 7;
- functie();
- {
- // scope 2
- a = 5;
- printf("In scope-ul 2: %d\n", a);
- functie();
- }
- printf("In scope-ul 1: %d\n", a);
- functie();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement