Advertisement
CotaIgnorada

Variables global

Oct 23rd, 2014
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.59 KB | None | 0 0
  1. /*programa con la variable global*/
  2. #include<stdio.h>
  3.          int x;  
  4.          void funcionA(){
  5.               x--;
  6.               printf("Funcion A %d\n", x);
  7.          }
  8.          void funcionB(){
  9.                 x++;
  10.                printf("Funcion B %d\n", x);
  11.          }
  12.          void funcionC(){
  13.                 x--;
  14.                 printf("Funcion C %d\n", x);
  15.        }
  16.          int main(){
  17.                     printf("Ingrese un valor de x\n");
  18.                     scanf("%d",&x);
  19.                     funcionA();
  20.                     funcionB();
  21.                     funcionC();
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement